The goal of this project is to verify the good integration of sqlite-better3 in an Electron application initiated with Electron Forge. This project must run on different operating systems: MacOS intel, MacOS M1, Windows and Linux. The use of node-gyp does not always make things obvious.
Clone the repo
git clone https://github.com/giloutho/test-better-sqlite3
It is not sure that a simple "npm intall" runs without errors. On the repository of better-sqlite3, here is a troubleshooting guide. After many hours, here is what seems essential :
- install the latest of node
- install latest Visual Studio Community and Desktop Development with C++ extension. Success with 2019 version
- run npm install as administrator
Tested on Ubuntu. This works directly without problems. "npm intall" and "npm start".
Tested on MacOS 10.15 (Catalina). This works directly without problems. "npm intall" and "npm start".
Tested on MacOS 12.2 (Monterey). This works directly without problems. "npm intall" and "npm start".
These tests were performed with :
- Electron 17
- Electron-forge 6
- better-sqlite3 7.5
This test create a database called sample.db with sql text files.
Some requests are made : Select, Select count, Insert and Delete.
Request results are displayed in the console