diff --git a/integration-tests/tools.js b/integration-tests/tools.js index 821ea7eb..846c2765 100644 --- a/integration-tests/tools.js +++ b/integration-tests/tools.js @@ -1,4 +1,8 @@ -global.DBGATE_TOOLS = require('dbgate-tools'); +global.DBGATE_PACKAGES = { + 'dbgate-tools': require('dbgate-tools'), + 'dbgate-sqltree': require('dbgate-sqltree'), +}; + const requireEngineDriver = require('dbgate-api/src/utility/requireEngineDriver'); const crypto = require('crypto'); @@ -44,16 +48,18 @@ async function connect(engine, database) { } } -const testWrapper = body => async (label, ...other) => { - const engine = other[other.length - 1]; - const driver = requireEngineDriver(engine.connection); - const conn = await connect(engine, randomDbName()); - try { - await body(conn, driver, ...other); - } finally { - await driver.close(conn); - } -}; +const testWrapper = + body => + async (label, ...other) => { + const engine = other[other.length - 1]; + const driver = requireEngineDriver(engine.connection); + const conn = await connect(engine, randomDbName()); + try { + await body(conn, driver, ...other); + } finally { + await driver.close(conn); + } + }; module.exports = { randomDbName, diff --git a/integration-tests/wait.js b/integration-tests/wait.js index ae3a6f09..a61339bb 100644 --- a/integration-tests/wait.js +++ b/integration-tests/wait.js @@ -1,7 +1,10 @@ const requireEngineDriver = require('dbgate-api/src/utility/requireEngineDriver'); const engines = require('./engines'); const { extractConnection } = require('./tools'); -global.DBGATE_TOOLS = require('dbgate-tools'); +global.DBGATE_PACKAGES = { + 'dbgate-tools': require('dbgate-tools'), + 'dbgate-sqltree': require('dbgate-sqltree'), +}; async function connectEngine(engine) { const connection = extractConnection(engine); diff --git a/packages/api/src/index.js b/packages/api/src/index.js index e75101be..4a9f78f2 100644 --- a/packages/api/src/index.js +++ b/packages/api/src/index.js @@ -97,10 +97,12 @@ if (processArgs.listenApi) { } const shell = require('./shell/index'); -const dbgateTools = require('dbgate-tools'); const currentVersion = require('./currentVersion'); -global['DBGATE_TOOLS'] = dbgateTools; +global.DBGATE_PACKAGES = { + 'dbgate-tools': require('dbgate-tools'), + 'dbgate-sqltree': require('dbgate-sqltree'), +}; if (processArgs.startProcess) { const proc = require('./proc'); diff --git a/packages/web/src/plugins/PluginsProvider.svelte b/packages/web/src/plugins/PluginsProvider.svelte index 42a10bce..7524f79e 100644 --- a/packages/web/src/plugins/PluginsProvider.svelte +++ b/packages/web/src/plugins/PluginsProvider.svelte @@ -1,6 +1,9 @@