|
|
@ -1208,10 +1208,8 @@ class BaseModelSqlv2 { |
|
|
|
!this.isSqlite, |
|
|
|
!this.isSqlite, |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
let children = await this.execAndParse(finalQb, childTable); |
|
|
|
const children = await this.execAndParse(finalQb, childTable); |
|
|
|
if (this.isMySQL) { |
|
|
|
|
|
|
|
children = children[0]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
const proto = await ( |
|
|
|
const proto = await ( |
|
|
|
await Model.getBaseModelSQL({ |
|
|
|
await Model.getBaseModelSQL({ |
|
|
|
id: rtnId, |
|
|
|
id: rtnId, |
|
|
@ -4408,7 +4406,7 @@ class BaseModelSqlv2 { |
|
|
|
let data = |
|
|
|
let data = |
|
|
|
this.isPg || this.isSnowflake |
|
|
|
this.isPg || this.isSnowflake |
|
|
|
? (await this.dbDriver.raw(query))?.rows |
|
|
|
? (await this.dbDriver.raw(query))?.rows |
|
|
|
: query.slice(0, 6) === 'select' && !this.isMssql |
|
|
|
: /^(\(|)select/.test(query) && !this.isMssql |
|
|
|
? await this.dbDriver.from( |
|
|
|
? await this.dbDriver.from( |
|
|
|
this.dbDriver.raw(query).wrap('(', ') __nc_alias'), |
|
|
|
this.dbDriver.raw(query).wrap('(', ') __nc_alias'), |
|
|
|
) |
|
|
|
) |
|
|
|