Fix schema and aliasing usage
This commit is contained in:
parent
dafa20ce47
commit
642f30416a
|
@ -472,14 +472,13 @@ class InternalBuilder {
|
||||||
): Knex.QueryBuilder {
|
): Knex.QueryBuilder {
|
||||||
const tableName = endpoint.entityId
|
const tableName = endpoint.entityId
|
||||||
const tableAlias = aliases?.[tableName]
|
const tableAlias = aliases?.[tableName]
|
||||||
let table: string | Record<string, string> = tableName
|
|
||||||
if (tableAlias) {
|
const query = knex(
|
||||||
table = { [tableAlias]: tableName }
|
this.tableNameWithSchema(tableName, {
|
||||||
}
|
alias: tableAlias,
|
||||||
let query = knex(table)
|
schema: endpoint.schema,
|
||||||
if (endpoint.schema) {
|
})
|
||||||
query = query.withSchema(endpoint.schema)
|
)
|
||||||
}
|
|
||||||
return query
|
return query
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue