jsonapi-express-backend-query
Version:
Homebrew lightweight wrappers for mysql and pgsql
8 lines (7 loc) • 351 B
JavaScript
module.exports = function(config) {
if(! config || ['mysql', 'pgsql'].indexOf(config.dialect) === -1) { // Leave sqlite for later, 'sqlite' |sqlite
throw new Error("config object's dialect key should be one of (mysql|pgsql) instead of " + config.dialect);
}
const { dialect } = config;
return require('./lib/' + dialect)(config);
}