Socket
Socket
Sign inDemoInstall

better-sqlite3

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-sqlite3 - npm Package Compare versions

Comparing version 0.8.2 to 0.9.0

benchmark/create-table.js

8

lib/database.js

@@ -6,8 +6,8 @@ 'use strict';

function Database(filename, options) {
if (typeof filename !== 'string') {
function Database(filenameGiven, options) {
if (typeof filenameGiven !== 'string') {
throw new TypeError('Expected argument 0 to be a string filename.');
}
filename = filename.trim();
var filename = filenameGiven.trim();
if (typeof options !== 'object' || options === null) {

@@ -39,3 +39,3 @@ options = {};

return new CPPDatabase(filename, NullFactory);
return new CPPDatabase(filename, filenameGiven, NullFactory);
}

@@ -42,0 +42,0 @@ CPPDatabase.prototype.constructor = Database;

{
"name": "better-sqlite3",
"version": "0.8.2",
"version": "0.9.0",
"description": "The fastest and most carefully designed library for SQLite3 in Node.js.",

@@ -19,3 +19,6 @@ "homepage": "http://github.com/JoshuaWise/better-sqlite3",

"chai": "^3.5.0",
"mocha": "^3.0.2"
"cli-color": "^1.1.0",
"fs-extra": "^0.30.0",
"mocha": "^3.0.2",
"sqlite3": "^3.1.4"
},

@@ -26,3 +29,4 @@ "scripts": {

"pretest": "rm -r ./temp/ || true && mkdir ./temp/",
"posttest": "rm -r ./temp/"
"posttest": "rm -r ./temp/",
"benchmark": "node benchmark"
},

@@ -29,0 +33,0 @@ "license": "MIT",

@@ -32,3 +32,3 @@ # better-sqlite3

- `node-sqlite3` uses asynchronous APIs for tasks that don't touch the hard disk. That's not only bad besign, but it wastes tons of resources.
- `node-sqlite3` forces you to manage the memory of SQLite3 statements yourself. `better-sqlite3` does it the JavaScript way, allowing the garbage collector to worry about memory management.
- `node-sqlite3` exposes low-level (C language) memory management functions. `better-sqlite3` does it the JavaScript way, allowing the garbage collector to worry about memory management.
- This module secretly splits your database connectino into two parts; a read-only connection, and a writable connection, which gives you completely atomic transactions and protects you from reading uncommitted data.

@@ -87,2 +87,6 @@

### *get* .filename -> string
Returns the string used to open the databse connection.
## class *Statement*

@@ -89,0 +93,0 @@

@@ -8,3 +8,3 @@ var expect = require('chai').expect;

expect(function () {db.pragma('cache_size');}).to.throw(Error);
})
});
it('should throw an exception if a string is not provided', function (done) {

@@ -20,3 +20,3 @@ var db = new Database('temp/12.2.db');

});
})
});
it('should throw an exception if invalid/redundant SQL is provided', function (done) {

@@ -28,3 +28,3 @@ var db = new Database('temp/12.3.db');

});
})
});
it('should execute the pragma, returning rows of strings', function (done) {

@@ -57,2 +57,9 @@ var db = new Database('temp/12.4.db');

});
it('should return undefined when no rows exist and simpler results are desired', function (done) {
var db = new Database('temp/12.7.db');
db.on('open', function () {
expect(db.pragma('table_info', true)).to.be.undefined;
done();
});
});
});

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

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