Socket
Socket
Sign inDemoInstall

mysql-pool

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.2.1

5

lib/mysql-pool/pool.js

@@ -12,2 +12,3 @@ "use strict";

EventEmitter.call(this);
this.properties = {};

@@ -24,3 +25,3 @@ // connections waiting for a query to execute

case "Client":
throw new Error("Deprecated: specify `library` instead of `Client`.");
throw new Error("Deprecated: specify `mysql` instead of `Client`.");
case "mysql":

@@ -42,3 +43,3 @@ case "poolSize":

} else if(typeof this.mysql == "string") {
this.mysql = require(this.library);
this.mysql = require(this.mysql);
}

@@ -45,0 +46,0 @@

2

package.json
{
"name": "mysql-pool",
"description": "MySQL connection pool for node.js on top of node-mysql.",
"version": "0.2.0",
"version": "0.2.1",
"homepage": "https://github.com/Kijewski/node-mysql-pool",

@@ -6,0 +6,0 @@ "repository": {

@@ -35,22 +35,24 @@ <a name="Readme"></a>

var MySQLPool = require("mysql-pool").MySQLPool;
var pool = new MySQLPool({
poolSize: 4,
user: 'root',
password: 'root',
database: 'test'
});
pool.query("SELECT 'Hello, World!' AS hello", function(err, rows, fields) {
if(err) throw err;
console.log(rows[0].hello);
});
for(var i = 0; i < 10; ++i) {
pool.query("SELECT SLEEP(2), ? AS i", [i], function(err, rows, fields) {
if(err) throw err;
console.log("Slept: " + rows[0].i);
});
}
```javascript
var MySQLPool = require("mysql-pool").MySQLPool;
var pool = new MySQLPool({
poolSize: 4,
user: 'root',
password: 'root',
database: 'test'
});
pool.query("SELECT 'Hello, World!' AS hello", function(err, rows, fields) {
if(err) throw err;
console.log(rows[0].hello);
});
for(var i = 0; i < 10; ++i) {
pool.query("SELECT SLEEP(2), ? AS i", [i], function(err, rows, fields) {
if(err) throw err;
console.log("Slept: " + rows[0].i);
});
}
```
You probably do not have to change anything if you already used

@@ -115,3 +117,3 @@ [node-mysql](https://github.com/felixge/node-mysql/)

mysqlPool.Pool(options)
mysqlPool.Pool([options])

@@ -121,3 +123,3 @@ creates a new, currently empty. Any property for the single connections or

If the parameter `poolsize` is omitted, the value of `client.poolsize`, or 1 is used.
If the parameter `poolsize` is omitted, 1 is used.

@@ -124,0 +126,0 @@ Only if all connection attemps failed `err` is supplied.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc