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

mysql-wrap-production

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-wrap-production - npm Package Compare versions

Comparing version 0.7.3 to 0.7.4

2

package.json
{
"name": "mysql-wrap-production",
"version": "0.7.3",
"version": "0.7.4",
"description": "Mysql interface and helper functions, wrapping node-mysql",

@@ -5,0 +5,0 @@ "main": "src/mysql-wrap.js",

@@ -139,7 +139,18 @@ 'use strict';

s.run = () => {
s.run = fig => {
let p = s.toParam();
return self.query(p.text, p.values);
return self.query(
_.extend({ sql: p.text }, fig || {}),
p.values
);
};
s.one = fig => {
let p = s.toParam();
return self.one(
_.extend({ sql: p.text }, fig || {}),
p.values
);
};
return s;

@@ -146,0 +157,0 @@ };

@@ -56,3 +56,4 @@ 'use strict';

it('should return query generator', function (done) {
this.sql.build().select().from('table').where('field = ?', 'bar').run()
this.sql.build().select().from('table')
.where('field = ?', this.b.field).run()
.then(resp => {

@@ -63,2 +64,26 @@ chai.assert.deepEqual(resp, [this.b]);

});
it('should be able to pass query options through "run" command', function (done) {
this.sql.build().select().from('table')
.where('id = ?', this.b.id).run({ resultCount: true })
.then(resp => {
chai.assert.deepEqual(
resp,
{
resultCount: 1,
results: [this.b]
}
);
done();
}).done();
});
it('should be invokable through a "one" command', function (done) {
this.sql.build().select().from('table')
.where('id = ?', this.b.id).one()
.then(resp => {
chai.assert.deepEqual(resp, this.b);
done();
}).done();
});
});

@@ -65,0 +90,0 @@

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