Skip to content

Commit

Permalink
fix(postgres): escapeId in DELETE statement (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
yhx-12243 committed Apr 25, 2024
1 parent 38e2134 commit 71ec8d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/postgres/src/index.ts
Expand Up @@ -324,7 +324,7 @@ export class PostgresDriver extends Driver<PostgresDriver.Config> {
const builder = new PostgresBuilder(this, sel.tables)
const query = builder.parseQuery(sel.query)
if (query === 'FALSE') return {}
const { count } = await this.query(`DELETE FROM ${sel.table} WHERE ${query}`)
const { count } = await this.query(`DELETE FROM ${builder.escapeId(sel.table)} WHERE ${query}`)
return { matched: count, removed: count }
}

Expand Down

0 comments on commit 71ec8d7

Please sign in to comment.