mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-03 11:43:57 +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,
|
mysql: true,
|
||||||
postgres: true,
|
postgres: true,
|
||||||
mssql: true,
|
mssql: true,
|
||||||
// oracle: true,
|
// oracle: true,
|
||||||
sqlite: true,
|
// sqlite: true,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ async function run() {
|
|||||||
port: process.env.PORT_oracle,
|
port: process.env.PORT_oracle,
|
||||||
engine: 'oracle@dbgate-plugin-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',
|
'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'
|
'C##my_guitar_shop'
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -58,6 +58,7 @@
|
|||||||
"install:drivers:packer": "node common/defineVolatileDependencies.js packer/build",
|
"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: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",
|
"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\"",
|
"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\"",
|
"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",
|
"ts:api": "yarn workspace dbgate-api ts",
|
||||||
|
|||||||
@@ -259,11 +259,21 @@ export class SqlDumper implements AlterProcessor {
|
|||||||
|
|
||||||
this.putRaw(' ');
|
this.putRaw(' ');
|
||||||
this.specialColumnOptions(column);
|
this.specialColumnOptions(column);
|
||||||
if (includeNullable && !this.dialect?.specificNullabilityImplementation) {
|
|
||||||
this.put(column.notNull ? '^not ^null' : '^null');
|
if (this.dialect?.defaultValueBeforeNullability) {
|
||||||
}
|
if (includeDefault && column.defaultValue?.toString()?.trim()) {
|
||||||
if (includeDefault && column.defaultValue?.toString()?.trim()) {
|
this.columnDefault(column);
|
||||||
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}`);
|
logger.info({ sql: dmp.s }, `Creating table ${fullNameQuoted}`);
|
||||||
await driver.script(dbhan, dmp.s);
|
await driver.script(dbhan, dmp.s);
|
||||||
structure = await driver.analyseSingleTable(dbhan, name);
|
structure = await driver.analyseSingleTable(dbhan, name);
|
||||||
|
writable.structure = structure;
|
||||||
|
}
|
||||||
|
if (!writable.structure) {
|
||||||
|
throw new Error(`Error importing table - ${fullNameQuoted} not found`);
|
||||||
}
|
}
|
||||||
if (options.truncate) {
|
if (options.truncate) {
|
||||||
await driver.script(dbhan, `TRUNCATE TABLE ${fullNameQuoted}`);
|
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;
|
requireFromDual?: boolean;
|
||||||
userDatabaseNamePrefix?: string; // c## in Oracle
|
userDatabaseNamePrefix?: string; // c## in Oracle
|
||||||
upperCaseAllDbObjectNames?: boolean;
|
upperCaseAllDbObjectNames?: boolean;
|
||||||
|
defaultValueBeforeNullability?: boolean;
|
||||||
|
|
||||||
predefinedDataTypes: string[];
|
predefinedDataTypes: string[];
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ const dialect = {
|
|||||||
userDatabaseNamePrefix: 'C##',
|
userDatabaseNamePrefix: 'C##',
|
||||||
upperCaseAllDbObjectNames: true,
|
upperCaseAllDbObjectNames: true,
|
||||||
requireStandaloneSelectForScopeIdentity: true,
|
requireStandaloneSelectForScopeIdentity: true,
|
||||||
|
defaultValueBeforeNullability: true,
|
||||||
|
|
||||||
createColumn: true,
|
createColumn: true,
|
||||||
dropColumn: true,
|
dropColumn: true,
|
||||||
@@ -177,6 +178,12 @@ END trigger_name;
|
|||||||
}
|
}
|
||||||
return dialect;
|
return dialect;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
adaptDataType(dataType) {
|
||||||
|
if (dataType?.toLowerCase() == 'datetime') return 'timestamp';
|
||||||
|
if (dataType?.toLowerCase() == 'text') return 'clob';
|
||||||
|
return dataType;
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = oracleDriver;
|
module.exports = oracleDriver;
|
||||||
|
|||||||
Reference in New Issue
Block a user