tmotagam / sqlite-electron

module for electron to use sqlite3 databases

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error db stays open when closing the application

K3yr0nym0us opened this issue · comments

I have a problem with sqlite-electron and it is that for some reason when the application closes the db doesn't, even the db starts to consume excessively ram in the background.

I have suspicions that this happens because when the app is refreshed it generates multiple instances of sqlite-electron and when closing the app it remains in a loop.

pd: I am using exactly the same code that appears as an example in the documentation.

Another problem that I am having is that when I have a database.db and in it multiple tables I cannot access all of them, for some reason it only returns the data of the first table that I access.

getProducts: async () => {
await ipcRenderer.invoke('set-path-db', './Products.db');
return await ipcRenderer.invoke('executeQuery', 'SELECT * FROM Products', 'all', 100)
},
getAlmacenes: async () => {
await ipcRenderer.invoke('set-path-db', './Products.db');
return await ipcRenderer.invoke('executeQuery', 'SELECT * FROM Almacenes', 'all', 100);
}

These two codes return what the first one only because the first one is executed before, I think that all this is because there is no way to close the connection with the db or if there is, it is not in the documentation.

Hi @K3yr0nym0us,
I am already working on the problem that the db stays open when closing the application. But the another problem that you have told me did not occur to me you can test with the example that is in the repo.