better-sqlite3
Advanced tools
Comparing version 2.3.2 to 2.3.3
{ | ||
"name": "better-sqlite3", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"description": "The fastest and simplest library for SQLite3 in Node.js.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/JoshuaWise/better-sqlite3", |
@@ -16,3 +16,3 @@ # better-sqlite3 [![Build Status](https://travis-ci.org/JoshuaWise/better-sqlite3.svg?branch=master)](https://travis-ci.org/JoshuaWise/better-sqlite3) | ||
|better-sqlite3|1x|1x|1x|1x|1x| | ||
|[sqlite](https://www.npmjs.com/package/sqlite) and [sqlite3](https://www.npmjs.com/package/sqlite3)|7.8x slower|2.7x slower|3.0x slower|3.2x slower|6.2x slower| | ||
|[sqlite](https://www.npmjs.com/package/sqlite) and [sqlite3](https://www.npmjs.com/package/sqlite3)|7.8x slower|3.3x slower|3.2x slower|3.6x slower|6.2x slower| | ||
@@ -19,0 +19,0 @@ > You can verify these results by [running the benchmark yourself](https://github.com/JoshuaWise/better-sqlite3/wiki/Benchmark). |
@@ -109,6 +109,4 @@ 'use strict'; | ||
}).to.throw(Error); | ||
db.prepare('INSERT INTO entries VALUES (?, @a, @a, ?)').run({a: 25, c: 25}, ['foo'], bufferOfSize(8).fill(0xdd)); | ||
expect(function () { | ||
db.prepare('INSERT INTO entries VALUES (?, @a, @a, ?)').run({a: 25, c: 25}, ['foo'], bufferOfSize(8).fill(0xdd)); | ||
}).to.throw(Error); | ||
expect(function () { | ||
db.prepare('INSERT INTO entries VALUES (?, @a, @a, ?)').run({}, ['foo'], bufferOfSize(8).fill(0xdd)); | ||
@@ -119,6 +117,4 @@ }).to.throw(Error); | ||
}).to.throw(Error); | ||
expect(function () { | ||
db.prepare('INSERT INTO entries VALUES (?, ?, ?, ?)').run('foo', 25, 25, bufferOfSize(8).fill(0xdd), {foo: 'foo'}); | ||
}).to.throw(Error); | ||
db.prepare('INSERT INTO entries VALUES (?, ?, ?, ?)').run('foo', 25, 25, bufferOfSize(8).fill(0xdd), {}); | ||
db.prepare('INSERT INTO entries VALUES (?, ?, ?, ?)').run('foo', 25, 25, bufferOfSize(8).fill(0xdd), {foo: 'foo'}); | ||
expect(function () { | ||
@@ -155,3 +151,3 @@ db.prepare('INSERT INTO entries VALUES (?, ?, ?, ?)').run('foo', 25, 25, {4: bufferOfSize(8).fill(0xdd)}); | ||
} | ||
expect(i).to.equal(9); | ||
expect(i).to.equal(11); | ||
}); | ||
@@ -158,0 +154,0 @@ }); |
@@ -98,6 +98,2 @@ 'use strict'; | ||
expect(function () { | ||
stmt.bind({a: '123', b: null}, null); | ||
}).to.throw(Error); | ||
expect(function () { | ||
stmt.bind({a: '123'}, null, null); | ||
@@ -107,3 +103,17 @@ }).to.throw(Error); | ||
stmt.bind({a: '123'}, null); | ||
stmt = db.prepare('INSERT INTO entries VALUES (@a, @a, ?)'); | ||
stmt.bind({a: '123', b: null}, null); | ||
}); | ||
it('should propagate exceptions thrown while accessing array/object members', function () { | ||
var arr = [22]; | ||
var obj = {}; | ||
var err = new TypeError('foobar'); | ||
Object.defineProperty(arr, '0', {get: function () {throw err;}}) | ||
Object.defineProperty(obj, 'baz', {get: function () {throw err;}}) | ||
var stmt1 = db.prepare('SELECT ?'); | ||
var stmt2 = db.prepare('SELECT @baz'); | ||
expect(function () {stmt1.bind(arr);}).to.throw(err); | ||
expect(function () {stmt2.bind(obj);}).to.throw(err); | ||
}); | ||
}); | ||
@@ -110,0 +120,0 @@ |
@@ -121,6 +121,4 @@ 'use strict'; | ||
expect(function () { | ||
db.transaction(['INSERT INTO entries VALUES (?, @a, @a, ?)', 'INSERT INTO entries VALUES (?, @a, @a, ?)']) | ||
.run({a: 25, c: 25}, ['foo'], bufferOfSize(8).fill(0xdd), ['foo'], bufferOfSize(8).fill(0xdd)); | ||
}).to.throw(Error); | ||
db.transaction(['INSERT INTO entries VALUES (?, @a, @a, ?)', 'INSERT INTO entries VALUES (?, @a, @a, ?)']) | ||
.run({a: 25, c: 25}, ['foo'], bufferOfSize(8).fill(0xdd), ['foo'], bufferOfSize(8).fill(0xdd)); | ||
@@ -137,6 +135,4 @@ expect(function () { | ||
expect(function () { | ||
db.transaction(['INSERT INTO entries VALUES (?, ?, ?, ?)', 'INSERT INTO entries VALUES (?, ?, ?, ?)']) | ||
.run('foo', 25, 25, bufferOfSize(8).fill(0xdd), 'foo', 25, 25, bufferOfSize(8).fill(0xdd), {foo: 'foo'}); | ||
}).to.throw(Error); | ||
db.transaction(['INSERT INTO entries VALUES (?, ?, ?, ?)', 'INSERT INTO entries VALUES (?, ?, ?, ?)']) | ||
.run('foo', 25, 25, bufferOfSize(8).fill(0xdd), 'foo', 25, 25, bufferOfSize(8).fill(0xdd), {foo: 'foo'}); | ||
@@ -191,3 +187,3 @@ db.transaction(['INSERT INTO entries VALUES (?, ?, ?, ?)', 'INSERT INTO entries VALUES (?, ?, ?, ?)']) | ||
} | ||
expect(i).to.equal(17); | ||
expect(i).to.equal(21); | ||
}); | ||
@@ -194,0 +190,0 @@ }); |
@@ -83,6 +83,2 @@ 'use strict'; | ||
expect(function () { | ||
trans.bind({a: '123', b: null}, null); | ||
}).to.throw(Error); | ||
expect(function () { | ||
trans.bind({a: '123'}, null, null); | ||
@@ -92,3 +88,17 @@ }).to.throw(Error); | ||
trans.bind({a: '123'}, null); | ||
trans = db.transaction(['INSERT INTO entries VALUES (@a, @a, ?)']); | ||
trans.bind({a: '123', b: null}, null); | ||
}); | ||
it('should propagate exceptions thrown while accessing array/object members', function () { | ||
var arr = [22]; | ||
var obj = {}; | ||
var err = new TypeError('foobar'); | ||
Object.defineProperty(arr, '0', {get: function () {throw err;}}) | ||
Object.defineProperty(obj, 'baz', {get: function () {throw err;}}) | ||
var trans1 = db.transaction(['INSERT INTO entries VALUES (NULL, ?, NULL)']); | ||
var trans2 = db.transaction(['INSERT INTO entries VALUES (NULL, @baz, NULL)']); | ||
expect(function () {trans1.bind(arr);}).to.throw(err); | ||
expect(function () {trans2.bind(obj);}).to.throw(err); | ||
}); | ||
}); | ||
@@ -95,0 +105,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2724292
2243
7