Error creating a local database #47
-
I was trying to create a function for Vue that creates a local database file (I tried many different libraries). I came to the conclusion that only import is available in Vite, and require is not, but require is necessary to work with files. As a result, I tried to write a function that creates a database in the main.ts (Electron file), (Because require is available in it) which I then export and call via Vue. I tried without IPC, with IPC. I've tried a lot of ways. It all comes down to mistakes. Tell me the solution to my problem. I'm trying to make it work with sqlite3 (I downloaded nock, mock and other libraries necessary for its operation).
In general, it doesn't matter to me which library to use, the main thing is that it can create local databases as a file, and then take values from Vue and put them there. I am grateful in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Can you show me how you setup your IPCs? You could even try to run some sqlite calls in the example IPC call this template comes with. If you want to play around quickly, you can enable |
Beta Was this translation helpful? Give feedback.
Glad you were able to make it work :)
Your latest example is the recommended way of communicating between processes. See: https://www.electronjs.org/docs/latest/tutorial/tutorial-preload#communicating-between-processes