Question about handling upsert case
What is the best way to handle this case for upserts?
in prisma, my upsert code looks like this:
If the post was being created,
if the post was being updated,
in drizzle, the upsert code i have now looks like this:
is there a better way to do this without needing to randomly generate the UUID for the
in prisma, my upsert code looks like this:
If the post was being created,
post.id would be undefined, thus the || '' would make it such that no post was found with id of '', so it would create a new postif the post was being updated,
post.id would exist and it would find the post with the matching id and update it.in drizzle, the upsert code i have now looks like this:
is there a better way to do this without needing to randomly generate the UUID for the
id field? in the prisma code it was able to find no match on the id field, and just use the auto generate rule for the id field rather than me having to manually set it