Browse Source

feat: use text for SingleLineText & URL (#8933)

pull/8950/head
Mert E 5 months ago committed by GitHub
parent
commit
40622297d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      packages/nocodb-sdk/src/lib/sqlUi/DatabricksUi.ts
  2. 24
      packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts
  3. 28
      packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts
  4. 10
      packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts
  5. 26
      packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts
  6. 26
      packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts

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

@ -58,7 +58,7 @@ export class DatabricksUi {
un: false, un: false,
ai: false, ai: false,
cdf: null, cdf: null,
clen: 45, clen: null,
np: null, np: null,
ns: null, ns: null,
dtxp: '', dtxp: '',
@ -176,7 +176,7 @@ export class DatabricksUi {
un: false, un: false,
ai: false, ai: false,
cdf: null, cdf: null,
clen: 45, clen: null,
np: null, np: null,
ns: null, ns: null,
dtxp: '', dtxp: '',

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

@ -68,9 +68,9 @@ export class MssqlUi {
{ {
column_name: 'title', column_name: 'title',
title: 'Title', title: 'Title',
dt: 'varchar', dt: 'TEXT',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: null,
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -78,10 +78,10 @@ export class MssqlUi {
un: false, un: false,
ai: false, ai: false,
cdf: null, cdf: null,
clen: 45, clen: null,
np: null, np: null,
ns: null, ns: null,
dtxp: '45', dtxp: '',
dtxs: '', dtxs: '',
altered: 1, altered: 1,
uidt: 'SingleLineText', uidt: 'SingleLineText',
@ -187,9 +187,9 @@ export class MssqlUi {
static getNewColumn(suffix) { static getNewColumn(suffix) {
return { return {
column_name: 'title' + suffix, column_name: 'title' + suffix,
dt: 'varchar', dt: 'TEXT',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: null,
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -197,10 +197,10 @@ export class MssqlUi {
un: false, un: false,
ai: false, ai: false,
cdf: null, cdf: null,
clen: 45, clen: null,
np: null, np: null,
ns: null, ns: null,
dtxp: '45', dtxp: '',
dtxs: '', dtxs: '',
altered: 1, altered: 1,
uidt: 'SingleLineText', uidt: 'SingleLineText',
@ -682,7 +682,7 @@ export class MssqlUi {
colProp.dt = 'varchar'; colProp.dt = 'varchar';
break; break;
case 'SingleLineText': case 'SingleLineText':
colProp.dt = 'varchar'; colProp.dt = 'text';
break; break;
case 'LongText': case 'LongText':
colProp.dt = 'text'; colProp.dt = 'text';
@ -733,7 +733,7 @@ export class MssqlUi {
}; };
break; break;
case 'URL': case 'URL':
colProp.dt = 'varchar'; colProp.dt = 'text';
colProp.validate = { colProp.validate = {
func: ['isURL'], func: ['isURL'],
args: [''], args: [''],
@ -819,7 +819,7 @@ export class MssqlUi {
case 'Attachment': case 'Attachment':
case 'Collaborator': case 'Collaborator':
case 'GeoData': case 'GeoData':
return ['char', 'ntext', 'text', 'varchar', 'nvarchar']; return ['text', 'varchar', 'nvarchar', 'char', 'ntext'];
case 'JSON': case 'JSON':
return ['text', 'ntext']; return ['text', 'ntext'];
@ -844,7 +844,7 @@ export class MssqlUi {
return ['varchar']; return ['varchar'];
case 'URL': case 'URL':
return ['varchar', 'text']; return ['text', 'varchar'];
case 'Number': case 'Number':
return [ return [

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

@ -72,9 +72,9 @@ export class MysqlUi {
{ {
column_name: 'title', column_name: 'title',
title: 'Title', title: 'Title',
dt: 'varchar', dt: 'TEXT',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: null,
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -82,10 +82,10 @@ export class MysqlUi {
un: false, un: false,
ai: false, ai: false,
cdf: null, cdf: null,
clen: 45, clen: null,
np: null, np: null,
ns: null, ns: null,
dtxp: '45', dtxp: '',
dtxs: '', dtxs: '',
altered: 1, altered: 1,
uidt: 'SingleLineText', uidt: 'SingleLineText',
@ -191,9 +191,9 @@ export class MysqlUi {
static getNewColumn(suffix) { static getNewColumn(suffix) {
return { return {
column_name: 'title' + suffix, column_name: 'title' + suffix,
dt: 'varchar', dt: 'TEXT',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: null,
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -201,10 +201,10 @@ export class MysqlUi {
un: false, un: false,
ai: false, ai: false,
cdf: null, cdf: null,
clen: 45, clen: null,
np: null, np: null,
ns: null, ns: null,
dtxp: '45', dtxp: '',
dtxs: '', dtxs: '',
altered: 1, altered: 1,
uidt: 'SingleLineText', uidt: 'SingleLineText',
@ -1010,7 +1010,7 @@ export class MysqlUi {
colProp.dt = 'varchar'; colProp.dt = 'varchar';
break; break;
case 'SingleLineText': case 'SingleLineText':
colProp.dt = 'varchar'; colProp.dt = 'text';
break; break;
case 'LongText': case 'LongText':
colProp.dt = 'text'; colProp.dt = 'text';
@ -1068,7 +1068,7 @@ export class MysqlUi {
}; };
break; break;
case 'URL': case 'URL':
colProp.dt = 'varchar'; colProp.dt = 'text';
colProp.validate = { colProp.validate = {
func: ['isURL'], func: ['isURL'],
args: [''], args: [''],
@ -1157,13 +1157,13 @@ export class MysqlUi {
case 'Collaborator': case 'Collaborator':
case 'GeoData': case 'GeoData':
return [ return [
'char',
'varchar',
'nchar',
'text', 'text',
'tinytext',
'mediumtext', 'mediumtext',
'longtext', 'longtext',
'varchar',
'char',
'nchar',
'tinytext',
]; ];
case 'Attachment': case 'Attachment':

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

@ -31,9 +31,9 @@ export class OracleUi {
{ {
column_name: 'title', column_name: 'title',
title: 'Title', title: 'Title',
dt: 'varchar', dt: 'TEXT',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: null,
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -41,7 +41,7 @@ export class OracleUi {
un: false, un: false,
ai: false, ai: false,
cdf: null, cdf: null,
clen: 45, clen: null,
np: null, np: null,
ns: null, ns: null,
dtxp: '45', dtxp: '45',
@ -817,7 +817,7 @@ export class OracleUi {
colProp.dt = 'varchar'; colProp.dt = 'varchar';
break; break;
case 'SingleLineText': case 'SingleLineText':
colProp.dt = 'varchar'; colProp.dt = 'clob';
break; break;
case 'LongText': case 'LongText':
colProp.dt = 'clob'; colProp.dt = 'clob';
@ -869,7 +869,7 @@ export class OracleUi {
}; };
break; break;
case 'URL': case 'URL':
colProp.dt = 'varchar'; colProp.dt = 'clob';
colProp.validate = { colProp.validate = {
func: ['isURL'], func: ['isURL'],
args: [''], args: [''],

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

@ -131,9 +131,9 @@ export class PgUi {
{ {
column_name: 'title', column_name: 'title',
title: 'Title', title: 'Title',
dt: 'character varying', dt: 'TEXT',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: null,
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -141,10 +141,10 @@ export class PgUi {
un: false, un: false,
ai: false, ai: false,
cdf: null, cdf: null,
clen: 45, clen: null,
np: null, np: null,
ns: null, ns: null,
dtxp: '45', dtxp: '',
dtxs: '', dtxs: '',
altered: 1, altered: 1,
uidt: 'SingleLineText', uidt: 'SingleLineText',
@ -249,9 +249,9 @@ export class PgUi {
static getNewColumn(suffix) { static getNewColumn(suffix) {
return { return {
column_name: 'title' + suffix, column_name: 'title' + suffix,
dt: 'character varying', dt: 'TEXT',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: null,
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -259,10 +259,10 @@ export class PgUi {
un: false, un: false,
ai: false, ai: false,
cdf: null, cdf: null,
clen: 45, clen: null,
np: null, np: null,
ns: null, ns: null,
dtxp: '45', dtxp: '',
dtxs: '', dtxs: '',
altered: 1, altered: 1,
uidt: 'SingleLineText', uidt: 'SingleLineText',
@ -1632,7 +1632,7 @@ export class PgUi {
colProp.dt = 'character varying'; colProp.dt = 'character varying';
break; break;
case 'SingleLineText': case 'SingleLineText':
colProp.dt = 'character varying'; colProp.dt = 'text';
break; break;
case 'LongText': case 'LongText':
colProp.dt = 'text'; colProp.dt = 'text';
@ -1683,7 +1683,7 @@ export class PgUi {
}; };
break; break;
case 'URL': case 'URL':
colProp.dt = 'character varying'; colProp.dt = 'text';
colProp.validate = { colProp.validate = {
func: ['isURL'], func: ['isURL'],
args: [''], args: [''],
@ -1784,10 +1784,10 @@ export class PgUi {
case 'LongText': case 'LongText':
case 'Collaborator': case 'Collaborator':
case 'GeoData': case 'GeoData':
return ['char', 'character', 'character varying', 'text']; return ['text', 'character varying', 'char', 'character'];
case 'Attachment': case 'Attachment':
return ['json', 'char', 'character', 'character varying', 'text']; return ['json', 'text', 'char', 'character', 'character varying'];
case 'JSON': case 'JSON':
return ['json', 'jsonb', 'text']; return ['json', 'jsonb', 'text'];
@ -1838,7 +1838,7 @@ export class PgUi {
return ['character varying']; return ['character varying'];
case 'URL': case 'URL':
return ['character varying', 'text']; return ['text', 'character varying'];
case 'Number': case 'Number':
return [ return [

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

@ -67,9 +67,9 @@ export class SnowflakeUi {
{ {
column_name: 'title', column_name: 'title',
title: 'Title', title: 'Title',
dt: 'varchar', dt: 'TEXT',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: null,
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -77,10 +77,10 @@ export class SnowflakeUi {
un: false, un: false,
ai: false, ai: false,
cdf: null, cdf: null,
clen: 45, clen: null,
np: null, np: null,
ns: null, ns: null,
dtxp: '45', dtxp: '',
dtxs: '', dtxs: '',
altered: 1, altered: 1,
uidt: 'SingleLineText', uidt: 'SingleLineText',
@ -185,9 +185,9 @@ export class SnowflakeUi {
static getNewColumn(suffix) { static getNewColumn(suffix) {
return { return {
column_name: 'title' + suffix, column_name: 'title' + suffix,
dt: 'varchar', dt: 'TEXT',
dtx: 'specificType', dtx: 'specificType',
ct: 'varchar(45)', ct: null,
nrqd: true, nrqd: true,
rqd: false, rqd: false,
ck: false, ck: false,
@ -195,10 +195,10 @@ export class SnowflakeUi {
un: false, un: false,
ai: false, ai: false,
cdf: null, cdf: null,
clen: 45, clen: null,
np: null, np: null,
ns: null, ns: null,
dtxp: '45', dtxp: '',
dtxs: '', dtxs: '',
altered: 1, altered: 1,
uidt: 'SingleLineText', uidt: 'SingleLineText',
@ -726,7 +726,7 @@ export class SnowflakeUi {
colProp.dt = 'VARCHAR'; colProp.dt = 'VARCHAR';
break; break;
case 'SingleLineText': case 'SingleLineText':
colProp.dt = 'VARCHAR'; colProp.dt = 'TEXT';
break; break;
case 'LongText': case 'LongText':
colProp.dt = 'TEXT'; colProp.dt = 'TEXT';
@ -776,7 +776,7 @@ export class SnowflakeUi {
}; };
break; break;
case 'URL': case 'URL':
colProp.dt = 'VARCHAR'; colProp.dt = 'TEXT';
colProp.validate = { colProp.validate = {
func: ['isURL'], func: ['isURL'],
args: [''], args: [''],
@ -864,10 +864,10 @@ export class SnowflakeUi {
case 'LongText': case 'LongText':
case 'Collaborator': case 'Collaborator':
case 'GeoData': case 'GeoData':
return ['CHAR', 'CHARACTER', 'VARCHAR', 'TEXT']; return ['TEXT', 'VARCHAR', 'CHARACTER', 'CHAR'];
case 'Attachment': case 'Attachment':
return ['TEXT', 'CHAR', 'CHARACTER', 'VARCHAR', 'text']; return ['TEXT', 'CHAR', 'CHARACTER', 'VARCHAR'];
case 'JSON': case 'JSON':
return ['TEXT']; return ['TEXT'];
@ -891,7 +891,7 @@ export class SnowflakeUi {
return ['VARCHAR']; return ['VARCHAR'];
case 'URL': case 'URL':
return ['VARCHAR', 'TEXT']; return ['TEXT', 'VARCHAR'];
case 'Number': case 'Number':
return [ return [

Loading…
Cancel
Save