Browse Source

fix: add TRUE/FALSE method support

pull/7019/head
Pranav C 1 year ago
parent
commit
a836994218
  1. 9
      packages/nocodb/src/db/functionMappings/commonFns.ts

9
packages/nocodb/src/db/functionMappings/commonFns.ts

@ -53,8 +53,6 @@ export default {
} }
return { builder: args.knex.raw(`CASE ${query}\n END${args.colAlias}`) }; return { builder: args.knex.raw(`CASE ${query}\n END${args.colAlias}`) };
}, },
TRUE: 1,
FALSE: 0,
AND: async (args: MapFnArgs) => { AND: async (args: MapFnArgs) => {
return { return {
builder: args.knex.raw( builder: args.knex.raw(
@ -112,8 +110,13 @@ export default {
builder: (await args.fn(args.pt?.arguments?.[0])).builder.wrap('(', ')'), builder: (await args.fn(args.pt?.arguments?.[0])).builder.wrap('(', ')'),
}; };
}, },
BLANK: async (args: MapFnArgs) => { BLANK: async (args: MapFnArgs) => {
return { builder: args.knex.raw(`?`, ['']) }; return { builder: args.knex.raw(`?`, ['']) };
}, },
TRUE: async (args: MapFnArgs) => {
return { builder: args.knex.raw(`?`, [1]) };
},
FALSE: async (args: MapFnArgs) => {
return { builder: args.knex.raw(`?`, [0]) };
},
}; };

Loading…
Cancel
Save