Browse Source

refactor: suggested changes

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/6470/head
Pranav C 1 year ago
parent
commit
b32de064d1
  1. 1
      packages/nocodb/src/db/BaseModelSqlv2.ts
  2. 7
      packages/nocodb/src/db/CustomKnex.ts

1
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -53,6 +53,7 @@ import {
} from '~/utils/globals';
dayjs.extend(utc);
dayjs.extend(timezone);
const GROUP_COL = '__nc_group_id';

7
packages/nocodb/src/db/CustomKnex.ts

@ -16,9 +16,6 @@ const pgTypes = {
NUMERIC: 1700,
};
// For the code, check out
// https://raw.githubusercontent.com/brianc/node-pg-types/master/lib/builtins.js
// override parsing date column to Date()
types.setTypeParser(pgTypes.DATE, (val) => val);
// override timestamp
@ -30,8 +27,8 @@ types.setTypeParser(pgTypes.TIMESTAMPTZ, (val) => {
return dayjs(val).utc().format('YYYY-MM-DD HH:mm:ssZ');
});
const parseFloatVal = (value: string) => {
return parseFloat(value);
const parseFloatVal = (val: string) => {
return parseFloat(val);
};
// parse integer values

Loading…
Cancel
Save