qc-client-pool
Pool Querycache connections for Node.js
Last updated a year ago by uzysjung .
MIT · Repository · Bugs · Original npm · Tarball
$ cnpm install qc-client-pool 
SYNC missed versions from official npm registry.

qc-client-pool

Pool Querycache connections for Node.js

Installation

$ npm install qc-client-pool

Examples

const QCPool = require("../index");
const co = require('co');
const qcPool = new QCPool({min: 5,max:10,queryTimeout:10000},'your_server','id','password');
co(function*(){

    try {

        let connection = yield qcPool.acquire();
        let sql = "select * from table limit 5";
        let result = yield qcPool.query(connection,sql);
        console.log("result Array:",result);

        connection = yield qcPool.acquire();
        sql = "select * from table limit 5";
        result = yield qcPool.query(connection,sql,{rowResultType:"Dictionary"});
        console.log("result Dictionary:",result);

    } catch(e) {
        console.log("error occurred :",e);
    }

    console.log("PoolSize : ",qcPool.getPoolSize());
    console.log("MaxPoolsize : ",qcPool.getMaxPoolSize());

});

License

MIT

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |