Stumped - sqlite kysely no data from select query
I have an electron app with
node-sqlite3
and kysely
. I'm able to post data, but for some reason select
comes up empty. I feel like I'm missing something low-level here. Thank you in advance. I've been banging my head on this off and on for 2 days.
db.ts
Post Service
3 Replies
You are using the
node-sqlite3
package that's not supported by Kysely in any way. You need to use the better-sqlite3
package. Please see the getting started documentation https://kysely.dev/docs/getting-started?dialect=sqlite
You also don't have await
in front of db.selectFrom('logs').selectAll().execute()
and you return the string 'results'
instead of the variable.Getting started | Kysely
Installation
I saw the preference in getting started, but hoped that was a "best practice". The electron boilerplate I am using doesn't support
better-sqlite3
. Can I create my own dialect
for node-sqlite3
not sure if this is a possibility.
Hey just wanted to say thanks for the response. I'm dropping kysely for this project and refactoring to use raw sql statments... kysely is a great tool and I look forward using it is prod. Maybe when I refactor the Electron App to use Electron Forage that can support better-sqlite3
... oof development, am I right. CheersIt is, go for it.
It's quite simple.