drizzle-orm
drizzle-orm copied to clipboard
[SQLite] Fix upsert targeting composite keys
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.