Nikky
03/24/2025, 10:30 PMRETURNING (xmax = 0) AS inserted
is a trick to determine if a row got inserted or updated (and i hope it still works) but sqldelight does not know what xmax
is
anyone got ideas on this ?
from: https://stackoverflow.com/questions/39058213/differentiate-inserted-and-updated-rows-in-upsert-using-system-columnsgriffio
03/25/2025, 2:02 PMdriver.execute
There are two issues - these can be created in https://github.com/sqldelight/sqldelight/issues
1. Support System Columns https://www.postgresql.org/docs/current/ddl-system-columns.html in all column results
2. Add support for expressions in RETURNING
Unless you can determine if the conflict column value is now returning a new value for the primary key (e.g generated by a sequence) or an updated column with a new timestamp the above solution seems still validNikky
03/27/2025, 2:36 PMON CONFLICT DO NOTHING RETURNING id
and thenredoing the insert ... we are preprocessig data enough that it should not too much of a issue