Report hasn't been filed before.
What version of drizzle-orm are you using?
0.44.7
What version of drizzle-kit are you using?
0.31.5
Other packages
No response
Describe the Bug
await db
.insert(payments)
.values({
id: pId,
idInvoice: props.invoiceId,
idUser: props.userId,
amount: props.amount,
completedAt: new Date(),
status: "paid",
metadata: paymentMetadata,
remarks: props.remarks,
})
.onConflictDoUpdate({
target: [payments.id, payments.idInvoice],
set: {
status: sql.raw(`excluded.${payments.status.name}`),
completedAt: sql.raw(`excluded.${payments.completedAt.name}`),
metadata: sql.raw(`excluded.${payments.metadata.name}`),
remarks: sql.raw(`excluded.${payments.remarks.name}`),
amount: sql.raw(`excluded.${payments.amount.name}`),
},
});
In the above query, we get an error that says column excluded.completedat does not exist. In the drizzle config, we have set the casing preference to be snake_case so the expectation is that the name should get resolved to excluded.completed_at by sql.raw().
There is no mention of this behavior in the docs.
For context, the project is a monorepo with typescript and uses Postgres with Neon under the hood.
Report hasn't been filed before.
What version of
drizzle-ormare you using?0.44.7
What version of
drizzle-kitare you using?0.31.5
Other packages
No response
Describe the Bug
In the above query, we get an error that says
column excluded.completedat does not exist. In the drizzle config, we have set the casing preference to be snake_case so the expectation is that the name should get resolved toexcluded.completed_atbysql.raw().There is no mention of this behavior in the docs.
For context, the project is a monorepo with typescript and uses Postgres with Neon under the hood.