Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
psql: Fix UPSERT query to respect conflict_target
The Postgres driver, for the following method call: record.Upsert(ctx, db, false, []string{"foo"}, boil.None(), boil.Infer()) ...would omit the conflict_target parameter[1], i.e. `foo`, from the query: INSERT INTO "cars" ("id", "foo") VALUES ($1,$2) ON CONFLICT DO NOTHING This patch changes the behavior so that the conflict_target is respected, resulting in the following: INSERT INTO "cars" ("id", "foo") VALUES ($1,$2) ON CONFLICT ("foo") DO NOTHING Fixes #1289 [1] https://www.postgresql.org/docs/15/sql-insert.html#SQL-ON-CONFLICT
- Loading branch information