开发者社区> 镜像站> NPM> mysql-connection
mysql-connection

An abstraction of mysql2 pooling for simple queries

use mysql/mysql2's inbuilt pool.query instead
Last updated 6 years ago by confuser .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install mysql-connection 
SYNC missed versions from official npm registry.

mysql-connection

Build Status Coverage Status

An abstraction of mysql2 pooling for simple queries.

Installation

npm install mysql-connection --save

Usage


var Db = require('mysql-connection')
  , mysql = require('mysql2')
  , settings =
    { host: 'localhost'
    , user: 'root'
    , password: ''
    , database: 'test'
    , connectionLimit: 2
    }
  , db = new Db(mysql2, settings)

// Simple query
db.query('sql here', [ 'params' ], function (error, data) {
  console.log(data)
})

// Access node-mysql2 pool
db.pool.getConnection(error, connection) {
  connection.release()
})

Current Tags

  • 1.0.2                                ...           latest (6 years ago)

4 Versions

  • 1.0.2 [deprecated]           ...           6 years ago
  • 1.0.1 [deprecated]           ...           6 years ago
  • 1.0.0 [deprecated]           ...           6 years ago
  • 0.0.1 [deprecated]           ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (7)
Dependents (0)
None