Browse Source

fix: exclude unsupported functions

pull/7019/head
Pranav C 1 year ago
parent
commit
07a552dd56
  1. 23
      packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts
  2. 4
      packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts
  3. 4
      packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts
  4. 12
      packages/nocodb-sdk/src/lib/sqlUi/SqliteUi.ts

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

@ -620,16 +620,17 @@ export class MssqlUi {
} { } {
const colProp: any = {}; const colProp: any = {};
switch (col.uidt) { switch (col.uidt) {
case 'ID': { case 'ID':
const isAutoIncId = idType === 'AI'; {
const isAutoGenId = idType === 'AG'; const isAutoIncId = idType === 'AI';
colProp.dt = isAutoGenId ? 'varchar' : 'int'; const isAutoGenId = idType === 'AG';
colProp.pk = true; colProp.dt = isAutoGenId ? 'varchar' : 'int';
colProp.un = isAutoIncId; colProp.pk = true;
colProp.ai = isAutoIncId; colProp.un = isAutoIncId;
colProp.rqd = true; colProp.ai = isAutoIncId;
colProp.meta = isAutoGenId ? {ag: 'nc'} : undefined; colProp.rqd = true;
} colProp.meta = isAutoGenId ? { ag: 'nc' } : undefined;
}
break; break;
case 'ForeignKey': case 'ForeignKey':
colProp.dt = 'varchar'; colProp.dt = 'varchar';
@ -908,6 +909,6 @@ export class MssqlUi {
} }
static getUnsupportedFnList() { static getUnsupportedFnList() {
return []; return ['XOR', 'REGEX_MATCH', 'REGEX_EXTRACT', 'REGEX_REPLACE', 'VALUE'];
} }
} }

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

@ -1,4 +1,4 @@
import { NormalColumnRequestType } from '../Api' import { NormalColumnRequestType } from '../Api';
import UITypes from '../UITypes'; import UITypes from '../UITypes';
import { IDType } from './index'; import { IDType } from './index';
@ -938,7 +938,7 @@ export class OracleUi {
} }
static getUnsupportedFnList() { static getUnsupportedFnList() {
return []; return ['XOR', 'REGEX_MATCH', 'REGEX_EXTRACT', 'REGEX_REPLACE', 'VALUE'];
} }
} }

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

@ -374,7 +374,7 @@ export class SnowflakeUi {
static columnEditable(colObj) { static columnEditable(colObj) {
return colObj.tn !== '_evolutions' || colObj.tn !== 'nc_evolutions'; return colObj.tn !== '_evolutions' || colObj.tn !== 'nc_evolutions';
} }
/* /*
static extractFunctionName(query) { static extractFunctionName(query) {
const reg = const reg =
@ -972,7 +972,7 @@ export class SnowflakeUi {
} }
static getUnsupportedFnList() { static getUnsupportedFnList() {
return []; return ['XOR', 'REGEX_MATCH', 'REGEX_EXTRACT', 'REGEX_REPLACE', 'VALUE'];
} }
} }

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

@ -868,6 +868,16 @@ export class SqliteUi {
} }
static getUnsupportedFnList() { static getUnsupportedFnList() {
return ['LOG', 'EXP', 'POWER', 'SQRT']; return [
'LOG',
'EXP',
'POWER',
'SQRT',
'XOR',
'REGEX_MATCH',
'REGEX_EXTRACT',
'REGEX_REPLACE',
'VALUE',
];
} }
} }

Loading…
Cancel
Save