XataX
Xata13mo ago
ghqpio

Need help with: invalid SQL: table [main/excluded] not found

Using Kysely as a dialect. Trying to insert data and resolve conflict by using native PG "excluded" table when running into conflict.
My code:
return await this._db
      .insertInto('Reports')
      .values(values)
      .onConflict((oc) =>
        oc.column('id').doUpdateSet((eb) => ({
          name: eb.ref('excluded.name'),
        })),
      )
      .execute();


Hitting an error:
functions: Error: invalid SQL: table [main/excluded] not found
Was this page helpful?