masterquest-sqlite3.js/tests/setup.js

41 lines
823 B
JavaScript
Raw Normal View History

2015-12-01 04:44:52 +00:00
'use strict';
2015-08-28 03:33:46 +00:00
function run(opts) {
var config = require('../config.test.js');
var wrap = require('../lib/dbwrap');
2015-12-01 04:44:52 +00:00
var sqlite3 = require('sqlite3');
2015-08-28 03:33:46 +00:00
2015-12-01 04:44:52 +00:00
var db = new sqlite3.Database(config.filename);
return wrap.wrap(db, opts);
/*
var sqlite3 = require('sqlite3-cluster');
2015-08-28 03:33:46 +00:00
var promise = sqlite3.create({
standalone: true
, bits: 128
, filename: config.filename
, verbose: false
});
return promise.then(function (db) {
return db.init({ bits: 128, key: config.key });
}).then(function (db) {
2015-12-01 04:44:52 +00:00
return wrap.wrap(db, opts);
2015-08-28 03:33:46 +00:00
});
2015-12-01 04:44:52 +00:00
*/
2015-08-28 03:33:46 +00:00
/*
if (require.main === module) {
create({
key: '1892d335081d8d346e556c9c3c8ff2c3'
, bits: 128
, filename: '/tmp/authn.sqlcipher'
}).then(function (DB) {
});
}
*/
}
module.exports = run;
module.exports.run = run;