"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require('path');
const appRootPath = require('app-root-path').path;
var ormconfig;
try {
    ormconfig = require(path.resolve(appRootPath, 'ormconfig'));
}
catch (e) {
    ormconfig = require('@hatiolab/things-shell/ormconfig');
}
const typeorm_1 = require("typeorm");
const entities_1 = require("../entities");
exports.databaseInitializer = async () => {
    return await typeorm_1.createConnection(Object.assign({}, ormconfig, { entities: entities_1.entities })).then(async (connection, ...others) => {
        debugger;
        console.log('Database connection established');
    });
};
//# sourceMappingURL=database.js.map