Removing wrap for MySQL.
This commit is contained in:
parent
efdfbe7229
commit
b0252469ed
|
@ -991,10 +991,8 @@ class InternalBuilder {
|
||||||
this.on(`${toAlias}.${toPrimary}`, "=", `${throughAlias}.${toKey}`)
|
this.on(`${toAlias}.${toPrimary}`, "=", `${throughAlias}.${toKey}`)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// my-sql needs the where statement to be part of main query, not sub-query
|
|
||||||
if (sqlClient !== SqlClient.MY_SQL) {
|
subQuery = addCorrelatedWhere(subQuery, correlatedTo, correlatedFrom)
|
||||||
subQuery = addCorrelatedWhere(subQuery, correlatedTo, correlatedFrom)
|
|
||||||
}
|
|
||||||
|
|
||||||
const standardWrap = (select: string): Knex.QueryBuilder => {
|
const standardWrap = (select: string): Knex.QueryBuilder => {
|
||||||
subQuery = subQuery.select(`${toAlias}.*`)
|
subQuery = subQuery.select(`${toAlias}.*`)
|
||||||
|
@ -1018,11 +1016,7 @@ class InternalBuilder {
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
case SqlClient.MY_SQL:
|
case SqlClient.MY_SQL:
|
||||||
wrapperQuery = addCorrelatedWhere(
|
wrapperQuery = knex.raw(`json_arrayagg(json_object(${fieldList}))`)
|
||||||
standardWrap(`json_arrayagg(json_object(${fieldList}))`),
|
|
||||||
isManyToMany ? fromKey! : toKey!,
|
|
||||||
correlatedFrom
|
|
||||||
)
|
|
||||||
break
|
break
|
||||||
case SqlClient.ORACLE:
|
case SqlClient.ORACLE:
|
||||||
wrapperQuery = standardWrap(
|
wrapperQuery = standardWrap(
|
||||||
|
|
Loading…
Reference in New Issue