diego3g / electron-typescript-react

:electron: An Electron boilerplate including TypeScript, React, Jest and ESLint.
1.45k stars 295 forks source link

Sqlite and knex usage #84

Open caiulucas opened 2 years ago

caiulucas commented 2 years ago

How can I configure and use knex and sqlite in this boilerplate?

brennomeneses commented 2 years ago

You use like a MVC app. In bridge.ts:

// ...
test: (e: string) => {
    ipcRenderer.send('test', e)
  }

in main.ts

import Knex from 'knex';
// ...
ipcMain.on('test', (_, e) => {
    // Here you write your queries
  })