db
db copied to clipboard
Support PostgreSQL ON CONFLICT
https://www.postgresql.org/docs/current/sql-insert.html
I'm looking to write a query like;
INSERT INTO table ("col", "col2", "col3")
VALUES ($1, $2, $3),
($2, $1, NULL)
ON CONFLICT("col") DO NOTHING RETURNING col;
It seems `InsertReturning` seems close but is conflict handling supported anywhere? Alternatively, are there any viable workarounds to achieve the same effect or effectively write a raw insert query?
See https://github.com/upper/db/pull/298 and https://github.com/upper/db/pull/318.