Can I run the `migrate()` function exporting a raw SQL query in Drizzle ORM?

I am building a Tauri app with a local SQLite database, and I have access via JavaScript. Here's an example:
const result = await db.execute(
"INSERT INTO todos (id, title, status) VALUES ($1, $2, $3)",
[todos.id, todos.title, todos.status]
);
const result = await db.execute(
"INSERT INTO todos (id, title, status) VALUES ($1, $2, $3)",
[todos.id, todos.title, todos.status]
);
Is it possible to run migrations using Drizzle in this manner?
5 Replies
Angelelz
Angelelz12mo ago
I'm not sure I understand the question. What's a Tauri app?
Pistonmaster
Pistonmaster12mo ago
Build smaller, faster, and more secure desktop applications with a ...
Tauri is a framework for building tiny, blazing fast binaries for all major desktop platforms. Developers can integrate any front-end framework that compiles to HTML, JS and CSS for building their user interface.
Thomas van der Westen
ping
Angelelz
Angelelz12mo ago
I don't see why you couldn't If you can run queries, you should be able to use the migrate function You just have to give it the migration folder Hopefully you have access to a file system there
Thomas van der Westen
Thomas v.d. Westen 📒 (@tdwesten) on X
Last year, I managed to build a @TauriApps app using a local SQLite database and successfully implemented @DrizzleORM with migrations. To address the questions I received, I created a demo repository, which you can find here: https://t.co/YivzzWnjRt.
Twitter
Want results from more Discord servers?
Add your server