used sqlite with prebuilds again

This commit is contained in:
Jan Prochazka 2021-12-25 13:47:02 +01:00
parent ed3666ca05
commit 0252091158
4 changed files with 5 additions and 5 deletions

View File

@ -5,7 +5,7 @@
"author": "Jan Prochazka <jenasoft.database@gmail.com>",
"description": "Opensource database administration tool",
"dependencies": {
"better-sqlite3": "^7.4.5",
"better-sqlite3-with-prebuilds": "^7.4.3",
"electron-log": "^4.4.1",
"electron-store": "^8.0.1",
"electron-updater": "^4.6.1",

View File

@ -5,7 +5,7 @@ let fillContent = '';
if (process.platform == 'win32') {
fillContent += `content.msnodesqlv8 = () => require('msnodesqlv8');`;
}
fillContent += `content['better-sqlite3'] = () => require('better-sqlite3');`;
fillContent += `content['better-sqlite3-with-prebuilds'] = () => require('better-sqlite3-with-prebuilds');`;
const getContent = (empty) => `
// this file is generated automatically by script fillNativeModules.js, do not edit it manually

View File

@ -19,7 +19,7 @@
"dependencies": {
"async-lock": "^1.2.4",
"axios": "^0.21.1",
"better-sqlite3": "^7.4.5",
"better-sqlite3-with-prebuilds": "^7.4.3",
"body-parser": "^1.19.0",
"bufferutil": "^4.0.1",
"byline": "^5.0.0",

View File

@ -175,8 +175,8 @@ const driver = {
};
driver.initialize = (dbgateEnv) => {
if (dbgateEnv.nativeModules && dbgateEnv.nativeModules['better-sqlite3']) {
Database = dbgateEnv.nativeModules['better-sqlite3']();
if (dbgateEnv.nativeModules && dbgateEnv.nativeModules['better-sqlite3-with-prebuilds']) {
Database = dbgateEnv.nativeModules['better-sqlite3-with-prebuilds']();
}
};