From 9eaa037e1dfdc9e67834aba716603745f7878ee6 Mon Sep 17 00:00:00 2001 From: Pranav C <61551451+pranavxc@users.noreply.github.com> Date: Wed, 5 Oct 2022 19:25:58 +0530 Subject: [PATCH] fix(api): add missing decimal and integer types --- packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts b/packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts index 6ef73146c8..51dc2c994e 100644 --- a/packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts +++ b/packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts @@ -2,12 +2,20 @@ import UITypes from '../UITypes'; import { IDType } from './index'; // Ref - https://docs.oracle.com/cd/B28359_01/server.111/b28318/datatype.htm#CNCPT513 +// https://docs.oracle.com/cd/B19306_01/olap.102/b14346/dml_datatypes002.htm const dbTypes = [ 'CHAR', 'VARCHAR', 'VARCHAR2', 'NUMBER', + + 'INTEGER', + 'SHORTINTEGER', + 'LONGINTEGER', + 'DECIMAL', + 'SHORTDECIMAL', + 'NCHAR', 'NVARCHAR2', 'CLOB', @@ -35,6 +43,7 @@ const dbTypes = [ 'XMLType', 'UriType', ]; + export class OracleUi { static getNewTableColumns(): any[] { return [ @@ -435,6 +444,13 @@ export class OracleUi { case 'NCLOB': return 'string'; + case 'INTEGER': + case 'SHORTINTEGER': + case 'LONGINTEGER': + return 'integer'; + + case 'DECIMAL': + case 'SHORTDECIMAL': case 'NUMBER': case 'BINARY_FLOAT': case 'BINARY_DOUBLE': @@ -573,10 +589,10 @@ export class OracleUi { colProp.dt = 'NUMBER'; break; case 'Decimal': - colProp.dt = 'NUMBER'; + colProp.dt = 'DECIMAL'; break; case 'Currency': - colProp.dt = 'NUMBER'; + colProp.dt = 'DECIMAL'; colProp.validate = { func: ['isCurrency'], args: [''], @@ -712,13 +728,13 @@ export class OracleUi { ]; case 'Number': - return ['NUMBER']; + return ['INTEGER', 'SHORTINTEGER', 'LONGINTEGER', 'NUMBER']; case 'Decimal': - return ['NUMBER']; + return ['DECIMAL', 'SHORTDECIMAL', 'NUMBER']; case 'Currency': - return ['NUMBER']; + return ['DECIMAL', 'SHORTDECIMAL', 'NUMBER']; case 'Percent': return ['NUMBER']; @@ -734,7 +750,6 @@ export class OracleUi { case 'Date': return [ 'DATE', - 'TIMESTAMP', 'TIMESTAMP WITH LOCAL TIME ZONE', 'TIMESTAMP WITH TIME ZONE', @@ -745,7 +760,6 @@ export class OracleUi { case 'LastModifiedTime': return [ 'DATE', - 'TIMESTAMP', 'TIMESTAMP WITH LOCAL TIME ZONE', 'TIMESTAMP WITH TIME ZONE',