It is nicely stated in the conflict helper that where doesn't need a table name, but it still gets it.
{
type: 'insert',
table: 'entries',
values: [
{
orgId: '...',
otherId: '...',
amount: 1200,
},
],
conflict: {
target: {
columns: [
'orgId',
'otherId',
],
where: {
isDeleted: false,
},
},
action: {
update: {
amount: '$excluded.amount$',
},
},
},
}
insert into "entries" ("orgId", "otherId", "amount") values ($1, $2, $3)
on conflict ("orgId", "otherId") where "entries"."isDeleted" is false do update set "amount" = "excluded"."amount";
It is nicely stated in the conflict helper that where doesn't need a table name, but it still gets it.
mongo-sql/helpers/query/conflict.js
Line 69 in 1351b48
If I try something like
The result is