mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 02:06:01 +00:00
24 lines
762 B
JavaScript
24 lines
762 B
JavaScript
const _ = require('lodash');
|
|
const dbgateApi = require('dbgate-api');
|
|
|
|
async function load({ connection, outputDir }) {
|
|
await dbgateApi.loadDatabase(connection, outputDir);
|
|
|
|
// await connect(options);
|
|
// const { client } = options;
|
|
// const loadFunc = require(`./clients/${client}/load`);
|
|
// options.databaseStructure = await loadFunc(options);
|
|
// if (options.loadDataCondition) {
|
|
// const { tables } = options.databaseStructure;
|
|
// for (const tableName of _.keys(tables)) {
|
|
// const table = tables[tableName];
|
|
// if (!options.loadDataCondition(table)) continue;
|
|
// const data = await query(options, `SELECT * FROM [${tableName}]`);
|
|
// table.data = data;
|
|
// }
|
|
// }
|
|
// return options;
|
|
}
|
|
|
|
module.exports = load;
|