saltyshiomix / nextron

⚡ Next.js + Electron ⚡
https://npm.im/nextron
MIT License
3.91k stars 226 forks source link

Use Sqlite database #207

Closed hulxv closed 2 years ago

hulxv commented 3 years ago

How to can i use sqlite or another database in my project ?

gitE0Z9 commented 2 years ago

Is this issue updated? I used API route to get access to sqlite in development mode, but this method failed when in production mode.

hulxv commented 2 years ago

Is this issue updated? I used API route to get access to sqlite in development mode, but this method failed when in production mode.

Use it in backend -Electron- with any library you want like knex and send it to frontend by IpcMain, Because you can't export API route.

You can see how I use it in vnstat-client in this file.

gitE0Z9 commented 2 years ago

Thanks, I figured out that yesterday. Now I am using ipcMain and ipcRenderer to communicate.

One thing still confuses me is preload.js won't be found no matter I put it in main folder or renderer or app, I want to use the file for contextBridge feature read on electron documentation.