|
|
@ -157,14 +157,16 @@ const pg = { |
|
|
|
builder: args.knex.raw( |
|
|
|
builder: args.knex.raw( |
|
|
|
`CASE WHEN ${args.knex |
|
|
|
`CASE WHEN ${args.knex |
|
|
|
.raw( |
|
|
|
.raw( |
|
|
|
`${args.pt.arguments |
|
|
|
`${( |
|
|
|
.map(async (ar) => |
|
|
|
await Promise.all( |
|
|
|
(await args.fn(ar, '', 'OR')).builder.toQuery(), |
|
|
|
args.pt.arguments.map(async (ar) => |
|
|
|
|
|
|
|
(await args.fn(ar, '', 'OR')).builder.toQuery() |
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
) |
|
|
|
.join(' OR ')}`,
|
|
|
|
).join(' OR ')}` |
|
|
|
) |
|
|
|
) |
|
|
|
.wrap('(', ')') |
|
|
|
.wrap('(', ')') |
|
|
|
.toQuery()} THEN TRUE ELSE FALSE END ${args.colAlias}`,
|
|
|
|
.toQuery()} THEN TRUE ELSE FALSE END ${args.colAlias}` |
|
|
|
), |
|
|
|
), |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|