mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-17 23:45:59 +00:00
SYNC: some fixes
This commit is contained in:
committed by
Diflow
parent
afcb226111
commit
963994b1e5
@@ -2,6 +2,6 @@ module.exports = {
|
||||
mysql: true,
|
||||
postgres: true,
|
||||
mssql: true,
|
||||
// oracle: true,
|
||||
sqlite: true,
|
||||
// oracle: true,
|
||||
// sqlite: true,
|
||||
};
|
||||
|
||||
@@ -84,7 +84,7 @@ async function run() {
|
||||
port: process.env.PORT_oracle,
|
||||
engine: 'oracle@dbgate-plugin-oracle',
|
||||
},
|
||||
'DROP USER C##my_guitar_shop',
|
||||
'DROP USER c##my_guitar_shop CASCADE',
|
||||
'CREATE USER c##my_guitar_shop IDENTIFIED BY my_guitar_shop DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp QUOTA 10M ON users',
|
||||
'C##my_guitar_shop'
|
||||
);
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
"install:drivers:packer": "node common/defineVolatileDependencies.js packer/build",
|
||||
"prepare:docker": "yarn plugins:copydist && yarn build:web && yarn build:api && yarn copy:docker:build && yarn install:drivers:docker",
|
||||
"prepare:packer": "yarn plugins:copydist && yarn build:web && yarn build:api && yarn copy:packer:build",
|
||||
"build:e2e": "yarn build:lib && yarn prepare:packer",
|
||||
"start": "concurrently --kill-others-on-fail \"yarn start:api\" \"yarn start:web\"",
|
||||
"lib": "concurrently --kill-others-on-fail \"yarn start:sqltree\" \"yarn start:filterparser\" \"yarn start:datalib\" \"yarn start:tools\" \"yarn build:plugins:frontend:watch\"",
|
||||
"ts:api": "yarn workspace dbgate-api ts",
|
||||
|
||||
@@ -259,11 +259,21 @@ export class SqlDumper implements AlterProcessor {
|
||||
|
||||
this.putRaw(' ');
|
||||
this.specialColumnOptions(column);
|
||||
if (includeNullable && !this.dialect?.specificNullabilityImplementation) {
|
||||
this.put(column.notNull ? '^not ^null' : '^null');
|
||||
}
|
||||
if (includeDefault && column.defaultValue?.toString()?.trim()) {
|
||||
this.columnDefault(column);
|
||||
|
||||
if (this.dialect?.defaultValueBeforeNullability) {
|
||||
if (includeDefault && column.defaultValue?.toString()?.trim()) {
|
||||
this.columnDefault(column);
|
||||
}
|
||||
if (includeNullable && !this.dialect?.specificNullabilityImplementation) {
|
||||
this.put(column.notNull ? '^not ^null' : '^null');
|
||||
}
|
||||
} else {
|
||||
if (includeNullable && !this.dialect?.specificNullabilityImplementation) {
|
||||
this.put(column.notNull ? '^not ^null' : '^null');
|
||||
}
|
||||
if (includeDefault && column.defaultValue?.toString()?.trim()) {
|
||||
this.columnDefault(column);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,10 @@ export function createBulkInsertStreamBase(driver: EngineDriver, stream, dbhan,
|
||||
logger.info({ sql: dmp.s }, `Creating table ${fullNameQuoted}`);
|
||||
await driver.script(dbhan, dmp.s);
|
||||
structure = await driver.analyseSingleTable(dbhan, name);
|
||||
writable.structure = structure;
|
||||
}
|
||||
if (!writable.structure) {
|
||||
throw new Error(`Error importing table - ${fullNameQuoted} not found`);
|
||||
}
|
||||
if (options.truncate) {
|
||||
await driver.script(dbhan, `TRUNCATE TABLE ${fullNameQuoted}`);
|
||||
|
||||
1
packages/types/dialect.d.ts
vendored
1
packages/types/dialect.d.ts
vendored
@@ -63,6 +63,7 @@ export interface SqlDialect {
|
||||
requireFromDual?: boolean;
|
||||
userDatabaseNamePrefix?: string; // c## in Oracle
|
||||
upperCaseAllDbObjectNames?: boolean;
|
||||
defaultValueBeforeNullability?: boolean;
|
||||
|
||||
predefinedDataTypes: string[];
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ const dialect = {
|
||||
userDatabaseNamePrefix: 'C##',
|
||||
upperCaseAllDbObjectNames: true,
|
||||
requireStandaloneSelectForScopeIdentity: true,
|
||||
defaultValueBeforeNullability: true,
|
||||
|
||||
createColumn: true,
|
||||
dropColumn: true,
|
||||
@@ -177,6 +178,12 @@ END trigger_name;
|
||||
}
|
||||
return dialect;
|
||||
},
|
||||
|
||||
adaptDataType(dataType) {
|
||||
if (dataType?.toLowerCase() == 'datetime') return 'timestamp';
|
||||
if (dataType?.toLowerCase() == 'text') return 'clob';
|
||||
return dataType;
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = oracleDriver;
|
||||
|
||||
Reference in New Issue
Block a user