Angular Electron Desktop App Do Not Persist data in SQLite3 Database when App is Closed.
See original GitHub issueI am using SQLITE3 in my angular8-electron5 desktop app to store user login credentials so that when next they launch the app, they do not have to login, their login details will be retrieve from SQLite Database.
It works as expected during development, but when i build the .exe
file and run the app, it does not persist login credentials once the app is closed.
Below is my SQLite database connection credentials and my .sqlite3
file.
const connection = await createConnection({
type: 'sqlite',
synchronize: true,
logging: true,
logger: 'simple-console',
database: './typeormmodels/data/database.sqlite3',
entities: [User, Usertoken, Usersession],
});
Please help, i want the app to persist data even after it has been closed, this way users can use it offline without internet.
Issue Analytics
- State:
- Created 4 years ago
- Comments:10
Top Results From Across the Web
How to persist data in an Electron app? [closed] - Stack Overflow
After building a custom solution that communicates over IPC to node to save a JSON file, I have realized that it may be...
Read more >How to create an Electron app using Angular and SQLite3.
Now let's open our src/index.ts file and add some code to connect to the database. The two things we need to do are,...
Read more >Electron Tutorial: Data Persistence - Techiediaries
Throughout this tutorial, we are going to explore different approaches for persisting and retrieving data in cross-platform desktop applications ...
Read more >Connecting to Sqlite Database in Electron JS - YouTube
Nearly every application needs a database of some sort. Sqlite is a great choice for an Electron db. It's lightweight, it's portable and...
Read more >How to store user data in Electron - Cameron Nokes
Where should I store the data? · Mac OS: ~/Library/Application Support/<Your App Name (taken from the name property in package.json)> · Windows: C ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I got this working by referencing my database file like this:
To me, it seems like the database isn’t being embedded correctly. Its probably getting recreated in the production build at each run. May I suggest switching to a NeDB if feasible.