sqlite create new db file push programatically
Hi, I'm using
better-sqlite3
with drizzle
in my electron project and for my use case, I have some binary format data that my app can read, and I'd like to make an export to a new sqlite .db
file. I have the schemas and everything set up but I want to take the db file path from user input and just create new one on the spot and fill it with data. Is there a way to push my schema to this db file programatically just like drizzle-kit push
does normally?5 Replies
👋 drizzle kit will soon have a programmatic API (next week I guess, july 30th).
For now you can pass args to drizzle-kit (https://orm.drizzle.team/kit-docs/commands#prototype--push) ex:
I use drizzle kit programmatically like this for now
Maybe it can help?
Drizzle ORM - List of commands
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
thanks for the quick reply, I'll wait for the proper API if it should be coming so soon 🙂
Any update on the api, it would be great if we could just build a single file and send it the app/docker image to prod and update the database using it
GitHub
drizzle-orm/drizzle-kit/src/api.ts at main · drizzle-team/drizzle-orm
Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅 - drizzle-team/drizzle-orm
Import from “drizzle-kit/api” 🚀