Browse Source

fix: sanitize column name & unsanitize raw query

pull/2424/head
Wing-Kam Wong 2 years ago
parent
commit
e20a2dcf83
  1. 2
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

2
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

@ -311,7 +311,7 @@ class BaseModelSqlv2 {
);
}
qb.count(this.model.primaryKey?.column_name || '*', {
qb.count(sanitize(this.model.primaryKey?.column_name) || '*', {
as: 'count'
}).first();
const res = (await this.dbDriver.raw(unsanitize(qb.toQuery()))) as any;

Loading…
Cancel
Save