connectors
Nodejs Database connectors
Last updated 2 years ago by lior_amsalem .
ISC · Original npm · Tarball · package.json
$ cnpm install connectors 
SYNC missed versions from official npm registry.

Database Connectors

Nodejs unify database connectors

npm package issues pull requests bitHound Overall Score bitHound Code

How to

npm install connectors
// define array of connection info
let database = [
    {
        connector_name: 'mongoose',
        host: '127.0.0.1',
        port: '27017',
        db_name: 'db_test'
    }
];

// require somewhere globally during application start/setup/init
require('connectors').init(database);

// and use like that in your model:
const {mongoose} = require('connectors');
// or
db.rabbitmq.sendToQueue('queue_name', new Buffer('something...'))

Settings Configuration Example

const settings = [
    {
        connector_name: 'mongoose',
        host: 'localhost',
        port: '',
        db_name: ''
    },
    {
        connector_name: 'mysql',
        host: 'localhost',
        port: '',
        db_name: ''
    }
];

TODO:

  1. support multi connection at the same db.
  2. connect all configured db at once(async).
  3. consider if i need mysql + redis export in index.js
  4. mongoose promise is dep: "(node:11663) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html"

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

3 Versions

  • 1.0.0                                ...           2 years ago
  • 1.0.0-beta.1                                ...           3 years ago
  • 1.0.0-beta.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 4
Last Day 0
Last Week 2
Last Month 2
Dependencies (9)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |