Electron App - Use SQLite or CSV Files #14147
-
|
Hello, In the application I need use some data, so, I've been trying without success use data from sqlite database or csv files to show on tables in the application. Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
To use NodeJS related packages, u would be in the main process, not in the renderer process. You had 3 options: 1 - Preload Script - put all your code who requires NodeJS stuff in the preload script, so call them from the renderer process. https://quasar.dev/quasar-cli-vite/developing-electron-apps/electron-preload-script#introduction 2 - Main Process - put all your code who requires NodeNS in the main process, so use IPC (Main & Renderer) to allow the Renderer Process call the main Process. https://www.electronjs.org/docs/latest/tutorial/ipc 3 - Browser Friendly DB - use a db library who is browser friendly, like PouchDB, LokiJS, Dexie, etc. https://dexie.org/ Personally, i would pick the 3th option with the most abstract one database lib, namely, RxDB |
Beta Was this translation helpful? Give feedback.
To use NodeJS related packages, u would be in the main process, not in the renderer process.
You had 3 options:
1 - Preload Script - put all your code who requires NodeJS stuff in the preload script, so call them from the renderer process.
https://quasar.dev/quasar-cli-vite/developing-electron-apps/electron-preload-script#introduction
2 - Main Process - put all your code who requires NodeNS in the main process, so use IPC (Main & Renderer) to allow the Renderer Process call the main Process.
https://www.electronjs.org/docs/latest/tutorial/ipc
3 - Browser Friendly DB - use a db library who is browser friendly, like PouchDB, LokiJS, Dexie, etc.
https://dexie.org/
https://github.com/techfort…