Browse Source

Merge pull request #5645 from nocodb/fix/dateadd-formula

fix(nocodb): dateadd formula with negative offset
pull/5661/head
Raju Udava 2 years ago committed by GitHub
parent
commit
d9f7aee121
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts

8
packages/nocodb/src/db/formulav2/formulaQueryBuilderv2.ts

@ -805,11 +805,9 @@ async function _formulaQueryBuilder(
return { builder: query };
} else if (pt.type === 'UnaryExpression') {
const query = knex.raw(
`${pt.operator}${fn(
pt.argument,
null,
pt.operator,
).toQuery()}${colAlias}`,
`${pt.operator}${(
await fn(pt.argument, null, pt.operator)
).builder.toQuery()}${colAlias}`,
);
if (prevBinaryOp && pt.operator !== prevBinaryOp) {
query.wrap('(', ')');

Loading…
Cancel
Save