any way to push to a sqlite database using javascript? without using the command

I am making an app with electron and wants to save some data in a sqlite database using drizzle orm but i want the sqlite database file to be automatically created with the schema the first time the app launches
6 Replies
yxshv
yxshvOP16mo ago
I can do one thing, get the SQL query from table.getSQL().toQuery() and execute that query in better-sqlite3
Andrii Sherman
Andrii Sherman16mo ago
You can use migrate function from drizzle-orm https://orm.drizzle.team/kit-docs/overview#running-migrations
Andrii Sherman
Andrii Sherman16mo ago
to generate those sql migrations you can use drizzle-kit generate:sqlite
yxshv
yxshvOP16mo ago
oh thanks!
Want results from more Discord servers?
Add your server