@mojaloop/central-services-database
Shared database code for central services
Last updated 3 months ago by l1pcircleci .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @mojaloop/central-services-database 
SYNC missed versions from official npm registry.

central-services-database

Git Commit Git Releases Npm Version NPM Vulnerabilities CircleCI

Shared database code for central services

Contents:

Usage

The library supports both MySQL and Postgres. To use the library you can use the following configurations:

const connectionConfig = {
    client: 'mysql', //or 'pg' for postgres
    connection: {
      host: 'some-data-uri',
      port: '9999',
      user: 'user',
      password: 'password',
      database: 'databaseSchema'
    },
    pool: {
      // minimum size
      min: 2,
      // maximum size
      max: 10,
      // acquire promises are rejected after this many milliseconds
      // if a resource cannot be acquired
      acquireTimeoutMillis: 30000,
      // create operations are cancelled after this many milliseconds
      // if a resource cannot be acquired
      createTimeoutMillis: 3000,
      // destroy operations are awaited for at most this many milliseconds
      // new resources will be created after this timeout
      destroyTimeoutMillis: 5000,
      // free resouces are destroyed after this many milliseconds
      idleTimeoutMillis: 30000,
      // how often to check for idle resources to destroy
      reapIntervalMillis: 1000,
      // long long to idle after failed create before trying again
      createRetryIntervalMillis: 200
      // ping: function (conn, cb) { conn.query('SELECT 1', cb) }
    },
    debug: false
  }

Environmental variables

Currently all is set into the config.

Logging

Logs are sent to standard output by default.

Tests

Running the tests:

npm run test
npm run test:unit
npm run test:xunit
npm run test:coverage
npm run test:coverage-check

Tests include code coverage via istanbul. See the test/unit/ folder for testing scripts.

Auditing Dependencies

We use npm-audit-resolver along with npm audit to check dependencies for vulnerabilities, and keep track of resolved dependencies with an audit-resolv.json file.

To start a new resolution process, run:

npm run audit:resolve

You can then check to see if the CI will pass based on the current dependencies with:

npm run audit:check

And commit the changed audit-resolv.json to ensure that CircleCI will build correctly.

Current Tags

  • 10.6.0                                ...           latest (3 months ago)
  • 8.3.0-snapshot                                ...           snapshot (a year ago)

19 Versions

  • 10.6.0                                ...           3 months ago
  • 9.2.0                                ...           8 months ago
  • 9.1.0                                ...           8 months ago
  • 8.3.0-snapshot                                ...           a year ago
  • 8.2.1                                ...           a year ago
  • 8.2.0                                ...           a year ago
  • 7.4.0                                ...           a year ago
  • 7.3.0                                ...           a year ago
  • 5.2.1                                ...           2 years ago
  • 3.1.0-snapshot                                ...           2 years ago
  • 1.2.4-snapshotMYSQL                                ...           2 years ago
  • 1.2.3-snapshotMYSQL                                ...           3 years ago
  • 1.2.1-snapshotMYSQL                                ...           3 years ago
  • 1.2.0-snapshot                                ...           3 years ago
  • 0.4.2                                ...           3 years ago
  • 0.4.1                                ...           3 years ago
  • 1.1.0-snapshot                                ...           3 years ago
  • 0.4.0                                ...           3 years ago
  • 0.3.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (3)
Dev Dependencies (11)

Copyright 2014 - 2016 © taobao.org |