UNPKG

men-pack

Version:

men-pack is a collection of funcationalities that can helps developers to easily develop MongoDB Express Node Applications/Backend

17 lines (16 loc) 580 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.dbFactory = void 0; const MongoDBClient_1 = require("./mongodb/MongoDBClient"); const PostgreClient_1 = require("./postgresql/PostgreClient"); const dbFactory = (type) => { switch (type.toLowerCase()) { case "mongodb": return new MongoDBClient_1.MongoDBClient(); case "postgresql": return new PostgreClient_1.PostgresClient(); default: throw new Error(`Unsupported database type: ${type}`); } }; exports.dbFactory = dbFactory;