How to use the typeorm-adapter.default function in typeorm-adapter

To help you get started, we’ve selected a few typeorm-adapter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tmobile / jazz / core / jazz_acl / components / casbin.js View on Github external
async function dbConnection(config) {
  let conn;
  try {
    conn = await TypeORMAdapter.default.newAdapter({
      type: config.CASBIN.TYPE,
      host: config.CASBIN.HOST,
      port: config.CASBIN.PORT,
      username: config.CASBIN.USER,
      password: config.CASBIN.PASSWORD,
      database: config.CASBIN.DATABASE,
      timeout: config.CASBIN.TIMEOUT
    });
  } catch (err) {
    if (err.name !== "AlreadyHasActiveConnectionError") {
      logger.error(err.message);
      throw (errorHandlerModule.throwInternalServerError(err.message));
    }
  }

  return conn;

typeorm-adapter

TypeORM adapter for Casbin

Apache-2.0
Latest version published 9 months ago

Package Health Score

65 / 100
Full package analysis

Popular typeorm-adapter functions