Browse Source

Merge pull request #4767 from nocodb/fix/postgres-mod

fix(nocodb): MOD for postgres
pull/4775/head
Raju Udava 2 years ago committed by GitHub
parent
commit
1138c92351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      packages/nocodb/src/lib/db/sql-data-mapper/lib/sql/functionMappings/pg.ts

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

@ -148,6 +148,11 @@ const pg = {
})${colAlias}` })${colAlias}`
); );
}, },
MOD: ({ fn, knex, pt, colAlias }: MapFnArgs) => {
const x = fn(pt.arguments[0]);
const y = fn(pt.arguments[1]);
return knex.raw(`MOD((${x})::NUMERIC, (${y})::NUMERIC) ${colAlias}`);
},
}; };
export default pg; export default pg;

Loading…
Cancel
Save