dbmodel tool initial import

This commit is contained in:
Jan Prochazka
2023-01-28 18:48:52 +01:00
parent cf00af9e30
commit 258338cd2e
10 changed files with 330 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
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;