1.1.0 • Published 6 years ago

asmund-db v1.1.0

Weekly downloads
3
License
MIT
Repository
-
Last release
6 years ago

asmund-db

Asmund Database Module

Usage

const Db = require('asmund-db')

const options = {
  database: 'asmunddb',
  username: 'root',
  password: 'mypass',
  host: 'localhost',
  dialect: 'postgres',
  pool: {
    max: 10,
    min: 0,
    idle: 10000
  }
}

const db = new Db(options)

db.getUsers().then(users => {
  // do something with users
}).catch(err => {
  // do something with err
})

Or using callback

db.getUsers((err, users) => {
  if (err) {
    // do something with err
  }
  // do something with users
})