|
|
@ -133,7 +133,7 @@ export default async function generateLookupSelectQuery({ |
|
|
|
let nestedLookupColOpt: LookupColumn; |
|
|
|
let nestedLookupColOpt: LookupColumn; |
|
|
|
|
|
|
|
|
|
|
|
if (lookupColumn.uidt === UITypes.Lookup) { |
|
|
|
if (lookupColumn.uidt === UITypes.Lookup) { |
|
|
|
nestedLookupColOpt = await lookupColumn.getColOptions<LookupColumn>(); |
|
|
|
nestedLookupColOpt = await lookupColumn.getColOptions<LookupColumn>(); |
|
|
|
relationCol = await nestedLookupColOpt.getRelationColumn(); |
|
|
|
relationCol = await nestedLookupColOpt.getRelationColumn(); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
relationCol = lookupColumn; |
|
|
|
relationCol = lookupColumn; |
|
|
@ -309,7 +309,7 @@ export default async function generateLookupSelectQuery({ |
|
|
|
return { |
|
|
|
return { |
|
|
|
builder: knex |
|
|
|
builder: knex |
|
|
|
.select(knex.raw('json_agg(??)::text', [lookupColumn.title])) |
|
|
|
.select(knex.raw('json_agg(??)::text', [lookupColumn.title])) |
|
|
|
.from(selectQb), |
|
|
|
.from(selectQb.as(subQueryAlias)), |
|
|
|
}; |
|
|
|
}; |
|
|
|
/* |
|
|
|
/* |
|
|
|
// alternate approach with array_agg
|
|
|
|
// alternate approach with array_agg
|
|
|
|