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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save