Require only visible fields on views

This commit is contained in:
Adria Navarro 2024-12-12 13:57:44 +01:00
parent e2ec75ff40
commit 76b0a96b73
1 changed files with 10 additions and 1 deletions

View File

@ -150,10 +150,19 @@ export async function buildSqlFieldList(
table = source table = source
} }
for (let field of Object.values(table.schema)) { for (const field of Object.values(table.schema)) {
if (field.type !== FieldType.LINK || !relationships || !field.tableId) { if (field.type !== FieldType.LINK || !relationships || !field.tableId) {
continue continue
} }
if (
isView &&
source.schema?.[field.name] &&
!helpers.views.isVisible(source.schema[field.name])
) {
continue
}
const { tableName } = breakExternalTableId(field.tableId) const { tableName } = breakExternalTableId(field.tableId)
if (tables[tableName]) { if (tables[tableName]) {
fields = fields.concat(extractRealFields(tables[tableName], fields)) fields = fields.concat(extractRealFields(tables[tableName], fields))