Closed cchin25 closed 5 months ago
I'm not too familiar with Drizzle, but this behavior seems to be intentional?
Ideally there shouldn't be a ternary here though
I switched to the libsql
driver, and it works as expected.
encountered the same issue, can verify switching to libsql
gets things going. Used DATABASE_URL="file:./db.sqlite"
and it placed the file in the project root as expected.
encountered the same issue, can verify switching to
libsql
gets things going. UsedDATABASE_URL="file:./db.sqlite"
and it placed the file in the project root as expected.
How to use libsql here we have to change some file ?
@kom-senapati in your drizzle.config.ts
, edit to driver: 'libsql',
then npm install @libsql/client
, and finally in your .env
write: DATABASE_URL="file:./db.sqlite"
anyone wanna file a pr swapping better-sqlite with libsql?
Provide environment information
System: OS: Linux 5.10 Ubuntu 20.04.6 LTS (Focal Fossa) CPU: (24) x64 AMD Ryzen 9 5900X 12-Core Processor Memory: 14.36 GB / 15.57 GB Container: Yes Shell: 5.0.17 - /bin/bash Binaries: Node: 21.1.0 - ~/.nvm/versions/node/v21.1.0/bin/node npm: 10.2.0 - ~/.nvm/versions/node/v21.1.0/bin/npm pnpm: 8.6.2 - /usr/local/bin/pnpm bun: 1.0.0 - ~/.bun/bin/bun
Describe the bug
Creation flow halted because an "invalid url" error is thrown when trying to create a local sqlite db.
Reproduction repo
n/a
To reproduce
Repro:
npm create t3-app@latest
Follow "Next Steps"
npm run db:push
Receive the following error:
Uses default .env
Changing the DATABASE_URL to
file:db.sqlite
will generate a db file, but the file name is literallyfile:db.sqlite
My expectation would be when I run
npm run db:push
a file nameddb.sqlite
is generated at the root of my project.Additional information
No response