drizzle-kit bindings error with bun using local sqlite file
When I use my local sqlite file instead of my Turso DB, I get an error running
bunx drizzle-kit push:sqlite
The command works fine when using Turso.
I use Bun version 1.0.2
This is the error output (upper half):
4 Replies
After much trial, I resolved this by using
npm
alongside bun
. It doesn’t fix the underlying cause of the issue of course, but after I ran npm install
, all of my bun
commands worked, like bun —bun run db:push
or bunx drizzle-kit push:sqlite
Godspeed. It’s early, the ecosystem is evolving rapidly, and the juice is worth the squeeze for me to get bun, sveltekit, drizzle and turso working nicely with debugging.
Along the lines of bun in the ecosystem, I also created a PR for @libsql/libsql-client-ts
to resolve some issues that appear related to bun
and bigint
s being used to interpret boolean values.
https://github.com/libsql/libsql-client-ts/pull/113GitHub
Update sqlite3.ts by light-merlin-dark · Pull Request #113 · libsql...
1n and 0n were causing error:
RangeError: Loss of precision reading BigInt (0)
This resolved it:
else if (typeof value === "boolean") {
return value ? 1 : 0;
}
Was there a sp...
thanks @Merlin for the PR
will try it out for my issue
Aye. It’s a pleasure. For clarity, the resolution for me was to run npm install. That PR I created is separate, which seems to resolve another issue with bun and libsql related to booleans being interpreted as bigints. Cheers! 🌹✨
Just ran into this one and this thread saved my ty y'all 🙏