ZangetsuZ
Deno6mo ago
6 replies
Zangetsu

Running drizzle-kit for local SQLite databases with Deno

I have been going through old issues in the Deno and libSQL to check this specific problem.

Mainly,
- https://github.com/drizzle-team/drizzle-orm/discussions/3162
- https://github.com/denoland/deno/issues/19826
Provided solutions in both cases do not seem to be working for me.

This is my current setup,
- I have "nodeModulesDir": "auto", set in my deno.json.
- Schema is in ./src/db/schema.ts, drizzle config is in ./drizzle.config.ts, and the database is supposed to be in ./data/db.sqlite.

I can run the following command with npx or bun and it works just fine.
npx drizzle-kit push --dialect sqlite --schema ./src/db/schema.ts --url file:./data/db.sqlite 

However, when I try to run it with Deno, i get the fllowing error,
 $  deno run -A --node-modules-dir npm:drizzle-kit push --dialect sqlite --schema ./src/db/schema.ts --url file:./data/db.sqlite 
LibsqlError: URL_SCHEME_NOT_SUPPORTED: The client that uses Web standard APIs supports only "libsql:", "wss:", "ws:", "https:" and "http:" URLs, got "file:". For more information, please read https://github.com/libsql/libsql-client-ts#supported-urls

I really like how Deno handles my project. Is there some way I can get this to work with Deno and avoid using npx or node?
Was this page helpful?