sqlite3-cluster.js/test-standalone.js

41 lines
911 B
JavaScript
Raw Normal View History

'use strict';
function run() {
var sqlite3 = require('./standalone');
sqlite3.create({
key: '00000000000000000000000000000000'
, bits: 128
, filename: '/tmp/test.cluster.sqlcipher'
, verbose: null
, standalone: true
, serve: null
, connect: null
}).then(function (client) {
2015-07-24 22:11:10 +00:00
client.all("SELECT ?", ['Hello World!'], function (err, result) {
if (err) {
console.error('[ERROR] standalone');
console.error(err);
return;
}
console.log('[this] standalone');
console.log(this);
2015-07-24 22:11:10 +00:00
console.log('[result] standalone');
console.log(result);
});
});
}
run();
2015-07-24 22:11:10 +00:00
// The native Promise implementation ignores errors because... dumbness???
process.on('unhandledPromiseRejection', function (err) {
console.error('Unhandled Promise Rejection');
console.error(err);
console.error(err.stack);
process.exit(1);
});