"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initDb = exports.getDb = void 0;
const configLoader = require("../lib/config-loader");
const helpers = require("../lib/helpers");
const nedb_adapter_1 = require("./nedb-adapter");
let db = null;
function getDb() {
    return db;
}
exports.getDb = getDb;
function initDb() {
    const config = configLoader.getConfig();
    const dbAdapter = config.dbAdapter || 'nedb';
    if (dbAdapter === 'nedb') {
        db = new nedb_adapter_1.NedbAdapter();
        db.initDb();
    }
    else {
        throw new Error(helpers.format('Unknown database adapter: "{0}". Check the "dbAdapter" parameter in your configuration file', dbAdapter));
    }
}
exports.initDb = initDb;
//# sourceMappingURL=db-manager.js.map