Fix update query on PG-esque DBs
Some checks failed
Node.js CI / build (18.x) (push) Has been cancelled
Node.js CI / build (20.x) (push) Has been cancelled

This commit is contained in:
Mia 2025-04-16 14:15:59 -05:00
parent 079523cc32
commit b9efc2d1b0

View File

@ -294,7 +294,7 @@ export class DatabaseTable<Row, DB extends Database> {
// cockroach/pg do not support limit in update queries so we have to case this
return this.updateAll(data)`
WHERE "${this.primaryKeyName}" = ${primaryKey}
${this.db.type === 'mysql' ? SQL` LIMIT 1` : ''}
${this.db.type === 'mysql' ? SQL` LIMIT 1` : SQL``}
`;
}
}