Prevent repeated fields on select

This commit is contained in:
Adria Navarro 2024-12-16 16:02:10 +01:00
parent d60cc7aaf4
commit 0ef4a154ef
1 changed files with 8 additions and 6 deletions

View File

@ -158,12 +158,6 @@ export async function buildSqlFieldList(
const isView = sdk.views.isView(source)
if (isView) {
fields = Object.keys(helpers.views.basicFields(source))
} else {
fields = extractRealFields(source)
}
let table: Table
if (isView) {
table = await sdk.views.getTable(source.id)
@ -172,6 +166,14 @@ export async function buildSqlFieldList(
table = source
}
if (isView) {
fields = Object.keys(helpers.views.basicFields(source)).map(
c => `${table.name}.${c}`
)
} else {
fields = extractRealFields(source)
}
fields.push(
...getRequiredFields(
{