2

I'm searching some tutorial to setup a vue-electron(I'm using the vue-electron plugin) app with sqlite3 and knex.

dependency sqlite in package.json

enter image description here

here some configs from my vue.config.js to initiate

module.exports = {
  transpileDependencies: ["vuetify"],
  configureWebpack: {
    externals: {
      knex: "require('knex')"
    }
  },
  pluginOptions: {
    electronBuilder: {
      externals: ["sqlite3"],
      builderOptions: {
        extraResources: ["src/db/database.sqlite3"]
      },
      nodeModulesPath: ["../../node_modules", "./node_modules"]
    }
  }
};

I got the sqlite part working but is not clear how would I deal to open a connection, migrate and execute queries.

here is a structure what I try establish as screenshot

enter image description here

Where do I initiate the database, what would be an appropriate structure in this case

fefe
  • 8,755
  • 27
  • 104
  • 180
  • Hi @fefe. As it stands I think someone would have to write a tutorial to address this answer ;) no offence, I think maybe if you just narrow the scope a bit? Initialising the connection etc shouldn't be wildly different from a normal node program, and migrations can be run programmatically (https://knexjs.org/#Migrations-latest). – Rich Churcher Nov 28 '19 at 19:38
  • 1
    Hi @RichChurcher thanks for the feedback, so I tried to gather my tryings. I'm not sure if I on the right track on building the kernel of the app but this is what I'm trying – fefe Nov 28 '19 at 21:02
  • Did you ever get this to work? – Imaginativeone Mar 05 '23 at 01:43

0 Answers0