Including SQL files in vite bundle to for migration management at runtime
Hello,
I'm trying to make myself a little API endpoint to run migrations and rollbacks during runtime. I keep getting stuck on trying to include the directory with migrations in the vite build so that I can pass that directory to the
migrate()
function.
I'm assuming theres a setting in my vite config to do this, but I keep finding links back to this page https://vite.dev/guide/assets.html which is for individual files where as I want an entire directory.
Can anyone point me to what I'm looking for?
Aside: I'm not using drizzle kit because I want to enable particular users with permissions to press buttons on a UI to do this eventually. That means they'll never have DB credentials or codebase access.0 Replies