Browse Source

fix(api): remove nested select alias for oracledb

feat/oracle-support
Pranav C 2 years ago committed by Pranav C
parent
commit
39876b9c68
  1. 8
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/BaseModelSqlv2.ts

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

@ -1742,6 +1742,10 @@ class BaseModelSqlv2 {
return this.clientType === 'pg';
}
get isOracle() {
return this.clientType === 'oracledb';
}
get isMySQL() {
return this.clientType === 'mysql2' || this.clientType === 'mysql';
}
@ -2854,7 +2858,9 @@ class BaseModelSqlv2 {
? (await this.dbDriver.raw(query))?.rows
: query.slice(0, 6) === 'select' && !this.isMssql
? await this.dbDriver.from(
this.dbDriver.raw(query).wrap('(', ') __nc_alias')
this.dbDriver
.raw(query)
.wrap('(', this.isOracle ? ')' : ') __nc_alias')
)
: await this.dbDriver.raw(query),
childTable

Loading…
Cancel
Save