Generate proper select
This commit is contained in:
parent
544302a129
commit
0e0b6471d6
|
@ -292,7 +292,7 @@ class InternalBuilder {
|
||||||
|
|
||||||
const alias = this.getTableName(table)
|
const alias = this.getTableName(table)
|
||||||
const schema = this.table.schema
|
const schema = this.table.schema
|
||||||
if (!this.isFullSelectStatementRequired()) {
|
if (this.isFullSelectStatementRequired()) {
|
||||||
return [this.knex.raw("??", [`${alias}.*`])]
|
return [this.knex.raw("??", [`${alias}.*`])]
|
||||||
}
|
}
|
||||||
// get just the fields for this table
|
// get just the fields for this table
|
||||||
|
@ -1543,9 +1543,6 @@ class InternalBuilder {
|
||||||
|
|
||||||
// start building the query
|
// start building the query
|
||||||
let query = this.qualifiedKnex()
|
let query = this.qualifiedKnex()
|
||||||
if (resource?.fields) {
|
|
||||||
query = query.columns(resource?.fields)
|
|
||||||
}
|
|
||||||
|
|
||||||
// handle pagination
|
// handle pagination
|
||||||
let foundOffset: number | null = null
|
let foundOffset: number | null = null
|
||||||
|
|
|
@ -142,6 +142,7 @@ export async function buildSqlFieldList(
|
||||||
let table: Table
|
let table: Table
|
||||||
if (sdk.views.isView(source)) {
|
if (sdk.views.isView(source)) {
|
||||||
table = await sdk.views.getTable(source.id)
|
table = await sdk.views.getTable(source.id)
|
||||||
|
fields = fields.filter(f => table.schema[f].type !== FieldType.LINK)
|
||||||
} else {
|
} else {
|
||||||
table = source
|
table = source
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue