Slonik only allows you to execute one query at a time, so you cannot combine SELECT and UPDATE into one. In the context of the chosen stack, all you need to make a sane decision are the 3 criteria outlined in the post.
Yes, then it's not for me, unfortunately. All my REST API does UPDATE/INSERT then SELECT to return the most current version of the record to pick up database-inserted data like timestamps. I would need a different mechanism. Still, it is interesting for sure. Thanks for sharing.
Slonik only allows you to execute one query at a time, so you cannot combine SELECT and UPDATE into one. In the context of the chosen stack, all you need to make a sane decision are the 3 criteria outlined in the post.
Yes, then it's not for me, unfortunately. All my REST API does UPDATE/INSERT then SELECT to return the most current version of the record to pick up database-inserted data like timestamps. I would need a different mechanism. Still, it is interesting for sure. Thanks for sharing.
You can use the 'returning' keyword to make update and insert return the filled in columns. You don't need a select for that.