sqlite upgrade

This commit is contained in:
zadam 2020-04-09 21:20:14 +02:00
parent 50d3928dd5
commit 62bc05134e
3 changed files with 10 additions and 16 deletions

18
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "trilium",
"version": "0.41.0-beta",
"version": "0.41.1-beta",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -9163,20 +9163,10 @@
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true
},
"sql-template-strings": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/sql-template-strings/-/sql-template-strings-2.2.2.tgz",
"integrity": "sha1-PxFQiiWt384hejBCqdMAwxk7lv8=",
"optional": true
},
"sqlite": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/sqlite/-/sqlite-3.0.6.tgz",
"integrity": "sha512-5SW7HcN+s3TyqpsxOujXhQDCRSCgsxdiU0peT/Y9CT5T0rAsGLwtpXcMyQ7OzOPQ4YUZ5XiGlrwuuQbszr2xtw==",
"requires": {
"sql-template-strings": "^2.2.2",
"sqlite3": "^4.0.0"
}
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/sqlite/-/sqlite-4.0.5.tgz",
"integrity": "sha512-O4UAFN+YsZJw5d+iAfFttP1rE26AQOdaEnQgbCSlLgg++b5/v3Zkp5zBLnfcZrQi+BA+urVDrTA/FC5o/DUNFg=="
},
"sqlite3": {
"version": "4.1.1",

View file

@ -65,7 +65,7 @@
"serve-favicon": "2.5.0",
"session-file-store": "1.4.0",
"simple-node-logger": "18.12.24",
"sqlite": "3.0.6",
"sqlite": "4.0.5",
"sqlite3": "4.1.1",
"string-similarity": "4.0.1",
"tar-stream": "2.1.2",

View file

@ -2,6 +2,7 @@ const log = require('./log');
const dataDir = require('./data_dir');
const fs = require('fs');
const sqlite = require('sqlite');
const sqlite3 = require('sqlite3');
const resourceDir = require('./resource_dir');
const appInfo = require('./app_info');
const sql = require('./sql');
@ -13,7 +14,10 @@ const Option = require('../entities/option');
const TaskContext = require('./task_context.js');
async function createConnection() {
return await sqlite.open(dataDir.DOCUMENT_PATH, {Promise});
return await sqlite.open({
filename: dataDir.DOCUMENT_PATH,
driver: sqlite3.Database
});
}
const dbConnection = new Promise(async (resolve, reject) => {