Browse Source

geo data: update db type mappings

pull/5248/head
Daniel Spaude 2 years ago
parent
commit
5b7267e993
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 5
      packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts
  2. 4
      packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts
  3. 3
      packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts
  4. 4
      packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts
  5. 57
      packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts
  6. 4
      packages/nocodb-sdk/src/lib/sqlUi/SqliteUi.ts

5
packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts

@ -983,7 +983,6 @@ export class MssqlUi {
break;
case 'Date':
colProp.dt = 'date';
break;
case 'Year':
colProp.dt = 'int';
@ -1093,6 +1092,7 @@ export class MssqlUi {
case 'LongText':
case 'Attachment':
case 'Collaborator':
case 'GeoData':
return ['char', 'ntext', 'text', 'varchar', 'nvarchar'];
case 'JSON':
@ -1136,9 +1136,6 @@ export class MssqlUi {
case 'Decimal':
return ['decimal', 'float'];
case 'GeoData':
return ['decimal', 'float'];
case 'Currency':
return [
'int',

4
packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts

@ -973,6 +973,9 @@ export class MysqlUi {
case 'Attachment':
colProp.dt = 'text';
break;
case 'GeoData':
colProp.dt = 'text';
break;
case 'Checkbox':
colProp.dt = 'tinyint';
colProp.dtxp = 1;
@ -1107,6 +1110,7 @@ export class MysqlUi {
case 'SingleLineText':
case 'LongText':
case 'Collaborator':
case 'GeoData':
return [
'char',
'varchar',

3
packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts

@ -825,6 +825,9 @@ export class OracleUi {
case 'Attachment':
colProp.dt = 'clob';
break;
case 'GeoData':
colProp.dt = 'varchar';
break;
case 'Checkbox':
colProp.dt = 'tinyint';
colProp.dtxp = 1;

4
packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts

@ -1594,6 +1594,9 @@ export class PgUi {
case 'Attachment':
colProp.dt = 'text';
break;
case 'GeoData':
colProp.dt = 'text';
break;
case 'Checkbox':
colProp.dt = 'bool';
colProp.cdf = 'false';
@ -1734,6 +1737,7 @@ export class PgUi {
case 'SingleLineText':
case 'LongText':
case 'Collaborator':
case 'GeoData':
return ['char', 'character', 'character varying', 'text'];
case 'Attachment':

57
packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts

@ -686,6 +686,9 @@ export class SnowflakeUi {
case 'Attachment':
colProp.dt = 'TEXT';
break;
case 'GeoData':
colProp.dt = 'TEXT';
break;
case 'Checkbox':
colProp.dt = 'BOOLEAN';
colProp.cdf = '0';
@ -802,9 +805,7 @@ export class SnowflakeUi {
if (idType === 'AG') {
return ['VARCHAR'];
} else if (idType === 'AI') {
return [
'NUMBER'
];
return ['NUMBER'];
} else {
return dbTypes;
}
@ -814,6 +815,7 @@ export class SnowflakeUi {
case 'SingleLineText':
case 'LongText':
case 'Collaborator':
case 'GeoData':
return ['CHAR', 'CHARACTER', 'VARCHAR', 'TEXT'];
case 'Attachment':
@ -822,13 +824,7 @@ export class SnowflakeUi {
case 'JSON':
return ['TEXT'];
case 'Checkbox':
return [
'BIT',
'BOOLEAN',
'TINYINT',
'INT',
'BIGINT',
];
return ['BIT', 'BOOLEAN', 'TINYINT', 'INT', 'BIGINT'];
case 'MultiSelect':
return ['TEXT'];
@ -840,10 +836,7 @@ export class SnowflakeUi {
return ['INT'];
case 'Time':
return [
'TIMESTAMP',
'VARCHAR',
];
return ['TIMESTAMP', 'VARCHAR'];
case 'PhoneNumber':
case 'Email':
@ -872,7 +865,14 @@ export class SnowflakeUi {
];
case 'Decimal':
return ['DOUBLE', 'DOUBLE PRECISION', 'FLOAT', 'FLOAT4', 'FLOAT8', 'NUMERIC'];
return [
'DOUBLE',
'DOUBLE PRECISION',
'FLOAT',
'FLOAT4',
'FLOAT8',
'NUMERIC',
];
case 'Currency':
return [
@ -941,44 +941,27 @@ export class SnowflakeUi {
return ['VARCHAR'];
case 'Count':
return [
'NUMBER',
'INT',
'INTEGER',
'BIGINT',
];
return ['NUMBER', 'INT', 'INTEGER', 'BIGINT'];
case 'Lookup':
return ['VARCHAR'];
case 'Date':
return [
'DATE',
'TIMESTAMP',
];
return ['DATE', 'TIMESTAMP'];
case 'DateTime':
case 'CreateTime':
case 'LastModifiedTime':
return [
'TIMESTAMP',
];
return ['TIMESTAMP'];
case 'AutoNumber':
return [
'NUMBER',
'INT',
'INTEGER',
'BIGINT',
];
return ['NUMBER', 'INT', 'INTEGER', 'BIGINT'];
case 'Barcode':
return ['VARCHAR'];
case 'Geometry':
return [
'TEXT',
];
return ['TEXT'];
case 'Button':
default:

4
packages/nocodb-sdk/src/lib/sqlUi/SqliteUi.ts

@ -787,6 +787,9 @@ export class SqliteUi {
case 'Attachment':
colProp.dt = 'text';
break;
case 'GeoData':
colProp.dt = 'text';
break;
case 'Checkbox':
colProp.dt = 'boolean';
colProp.cdf = '0';
@ -923,6 +926,7 @@ export class SqliteUi {
case 'LongText':
case 'Attachment':
case 'Collaborator':
case 'GeoData':
return ['character', 'text', 'varchar'];
case 'Checkbox':

Loading…
Cancel
Save