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