drizzle-orm icon indicating copy to clipboard operation
drizzle-orm copied to clipboard

[SQLite] Fix upsert targeting composite keys

Open wkunert opened this issue 2 years ago • 0 comments

Fix for #518.

If the target consisted of multiple columns, they were wrapped in two pairs for parentheses, which was invalid SQL. Thanks @hirvesh for identifying the root cause of the failed SQL queries.

Also a target is required with "DO UPDATE" upserts now as per the spec (cp. https://www.sqlite.org/lang_UPSERT.html). Should not break existing code bases since queries without a target would have failed.

wkunert avatar Apr 26 '23 13:04 wkunert