You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now to do an "upsert" operation you have to do
(or (db/update! ...) ; update! returns truthy value iff something was updated
(db/insert!))
However, that is subject to race conditions 🙀
It would be nice to simplify this common pattern and avoid the race conditions with an upsert! function or something like that. (suggestion credit: @thearthur)
The text was updated successfully, but these errors were encountered:
i'd be happy to try working on this, can you suggest an implementation that would avoid the race condition?
ex. a query for existence first by id & then an insert/update based on that?
i know upsert is available in a few databases ~Postgres's INSERT ON CONFLICT but imagine raw SQL isn't an option bc that command isn't supported by all the dbs that u can connect to w JDBC.
Right now to do an "upsert" operation you have to do
However, that is subject to race conditions 🙀
It would be nice to simplify this common pattern and avoid the race conditions with an
upsert!
function or something like that. (suggestion credit: @thearthur)The text was updated successfully, but these errors were encountered: