mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 21:46:00 +00:00
NPM plugin refactor
This commit is contained in:
@@ -31,10 +31,15 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"dbgate-plugin-tools": "^1.0.8",
|
||||
"dbgate-query-splitter": "^4.11.2",
|
||||
"dbgate-tools": "^5.0.0-alpha.1",
|
||||
"lodash": "^4.17.21",
|
||||
"webpack": "^5.91.0",
|
||||
"webpack-cli": "^5.1.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"dbgate-query-splitter": "^4.11.2",
|
||||
"dbgate-tools": "^5.0.0-alpha.1",
|
||||
"lodash": "^4.17.21"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"oracledb": "^6.6.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,13 +6,12 @@ const Analyser = require('./Analyser');
|
||||
const { createBulkInsertStreamBase, makeUniqueColumnNames } = global.DBGATE_PACKAGES['dbgate-tools'];
|
||||
const createOracleBulkInsertStream = require('./createOracleBulkInsertStream');
|
||||
|
||||
let requireOracledb;
|
||||
let platformInfo;
|
||||
|
||||
let oracledbValue;
|
||||
function getOracledb() {
|
||||
if (!oracledbValue) {
|
||||
oracledbValue = requireOracledb();
|
||||
oracledbValue = require('oracledb');
|
||||
}
|
||||
return oracledbValue;
|
||||
}
|
||||
@@ -359,9 +358,6 @@ const driver = {
|
||||
};
|
||||
|
||||
driver.initialize = dbgateEnv => {
|
||||
if (dbgateEnv.nativeModules && dbgateEnv.nativeModules['oracledb']) {
|
||||
requireOracledb = dbgateEnv.nativeModules['oracledb'];
|
||||
}
|
||||
platformInfo = dbgateEnv.platformInfo;
|
||||
};
|
||||
|
||||
|
||||
@@ -35,6 +35,12 @@ var config = {
|
||||
},
|
||||
}),
|
||||
],
|
||||
|
||||
externals: {
|
||||
'dbgate-tools': 'commonjs dbgate-tools',
|
||||
'dbgate-query-splitter': 'commonjs dbgate-query-splitter',
|
||||
lodash: 'commonjs lodash',
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = config;
|
||||
|
||||
Reference in New Issue
Block a user