Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mysql-promise

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-promise - npm Package Compare versions

Comparing version 1.4.0 to 1.5.0

CHANGELOG.md

8

index.js

@@ -20,2 +20,10 @@ 'use strict';

/**
* Check if a pool has been configured for this instane.
* @return {Boolean}
*/
DB.prototype.isConfigured = function () {
return !!this.pool;
};
/**
* Run DB query

@@ -22,0 +30,0 @@ * @param {String} query

6

package.json
{
"name": "mysql-promise",
"version": "1.4.0",
"version": "1.5.0",
"description": "Small wrapper for mysql that use promises.",

@@ -29,4 +29,4 @@ "main": "index.js",

"dependencies": {
"bluebird": "^2.1.3",
"mysql": "^2.3.2"
"bluebird": "^2.10.2",
"mysql": "^2.10.2"
},

@@ -33,0 +33,0 @@ "devDependencies": {

# mysql-promise
Small wrapper for mysql that use promises.
Small wrapper for [mysql](https://www.npmjs.com/package/mysql) that use promises.

@@ -36,8 +36,11 @@ [![build status](https://secure.travis-ci.org/martinj/node-mysql-promise.png)](http://travis-ci.org/martinj/node-mysql-promise)

db2.configure({
"host": "localhost",
"user": "foo",
"password": "bar",
"database": "another-db"
});
//check if has already been configured
if (!db2.isConfigured()) {
db2.configure({
"host": "localhost",
"user": "foo",
"password": "bar",
"database": "another-db"
});
}

@@ -44,0 +47,0 @@ db2.query('SELECT * FROM users').spread(function (users) {

@@ -13,2 +13,23 @@ 'use strict';

});
});
describe('isConfigured()', function () {
it('should return false if it has no pool configured', function () {
var defaultDb = db();
defaultDb.isConfigured().should.be.false;
});
it('should return false if it has no pool configured', function () {
var defaultDb = db();
defaultDb.configure({
host: "localhost",
user: "foo",
password: "bar",
database: "db"
})
defaultDb.isConfigured().should.be.true;
});
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc