1
0
Fork 0
mirror of synced 2024-08-05 13:21:26 +12:00

Small re-jig make things easier to read.

This commit is contained in:
mike12345567 2024-06-14 19:04:02 +01:00
parent f3ca1d0b1e
commit cd1e7c0bad

View file

@ -672,15 +672,16 @@ export class ExternalRequest<T extends Operation> {
// aliasing can be disabled fully if desired
let response
const aliasing = new sdk.rows.AliasTables(Object.keys(this.tables))
if (env.SQL_ALIASING_DISABLE) {
response = await getDatasourceAndQuery(json)
} else if (this.operation === Operation.COUNT) {
// if it's a counting operation there will be no more processing, just return the number
if (this.operation === Operation.COUNT) {
return (await aliasing.countWithAliasing(
json,
makeExternalQuery
)) as ExternalRequestReturnType<T>
} else {
response = await aliasing.queryWithAliasing(json, makeExternalQuery)
response = env.SQL_ALIASING_DISABLE
? await getDatasourceAndQuery(json)
: await aliasing.queryWithAliasing(json, makeExternalQuery)
}
const responseRows = Array.isArray(response) ? response : []