DenoDDeno
Powered by
ZangetsuZ
Deno•11mo 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", "nodeModulesDir": "auto", set in my deno.jsondeno.json.
- Schema is in ./src/db/schema.ts./src/db/schema.ts, drizzle config is in ./drizzle.config.ts./drizzle.config.ts, and the database is supposed to be in ./data/db.sqlite./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 
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
 $  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?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,905Members
Resources

Similar Threads

Was this page helpful?

Continue the conversation

Join the Discord to ask follow-up questions and connect with the community

DenoD

Deno

Chat about Deno, a modern runtime for JavaScript and TypeScript.

20,905 Members

Join

Similar Threads

drizzle orm for deno and sqlite?
smailSsmail / help
3y ago
Deno drizzle-kit migrate:pg
Stupendously StupidSStupendously Stupid / help
3y ago
I run "deno -A npm:drizzle-kit generate", deno hits me with "Cannot find module 'drizzle-kit'"
ClintonnCClintonn / help
16mo ago
denodrivers/sqlite and deno-sqlit behave different with multiple `?` args
adoublefAadoublef / help
3y ago