Browse Source

fix(nocodb): incorrect OR builder

pull/5472/head
Wing-Kam Wong 2 years ago
parent
commit
b594c5a035
  1. 10
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/pg.ts

10
packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/pg.ts

@ -157,11 +157,13 @@ 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}`

Loading…
Cancel
Save