Browse Source

fix: allow optional scale and precision params along with datatype

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5613/head
Pranav C 2 years ago
parent
commit
4f7d52b9a2
  1. 2
      packages/nocodb/src/db/sql-client/lib/KnexClient.ts

2
packages/nocodb/src/db/sql-client/lib/KnexClient.ts

@ -2970,7 +2970,7 @@ class KnexClient extends SqlClient {
sanitiseDataType(dt: string) { sanitiseDataType(dt: string) {
// allow only alphanumeric and space // allow only alphanumeric and space
// eg: varchar, int, bigint, text, character varying, etc // eg: varchar, int, bigint, text, character varying, etc
if (/^[\w -]+$/.test(dt)) return dt; if (/^[\w -]+(?:\(\d+(?:\s?,\s?\d+)?\))?$/.test(dt)) return dt;
throw new Error(`Invalid data type: ${dt}`); throw new Error(`Invalid data type: ${dt}`);
} }

Loading…
Cancel
Save