You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Runs the tests fine, I have visual output in browser with Drizzle Studio.
I started running some quick Nuxt 3 tests with forked builds of db0.
Also noticed there are multiple ways to go by this... .
The connector runs on ./libsql/node and relies on url and authToken instead of local filePath. The way I went about it is just by creating a ./libsql/turso.ts version of ./libsql/node. You could technically do the same if the 'file:' prefix wasnt hardcoded for local dev db's.
From a Full Stack development pov, I would personally love to automagically detect wether your running better-sqlite3 locally by simply ommitting or including your Turso .env variables.
I've finished my research and testing.
There is no need to create a new adapter/connector or integration for Turso DB support, it already works as it is.
The hardcoding of 'file:' in the libsql module apparently somewhere overrides itself when you enter a libsql: url, which just dissolves the entire problem to begin with.
I have a article available with the current build of Nuxt (excluding the experimental databse(db0) module for comparison sake).
You can test the current build (Nuxt 3.10) with @libsql/client directly in Nitro 'server/utils/db.ts' route. Article Github Repo
I'm finishing up my update post about the new experimental route.
"Nuxt Experimental Features: Connect your Turso DB natively with db0 and Drizzle" Github Repo Nightly Branch
The new db0 module offers so much extra DX, I wish you knew how happy I am with it already.
No need to create useDatabase() as it's already here now.
No need to setup useDatabase(), it configures itself from nuxt/nitro.config
No need to setup your own dev database at all, ever, it configures itself.
Combined with Nuxt Auth Utils, this will become an even bigger banger feature imo. making it a no-brainer.
Great work! I really hope this makes it into the main Nuxt build.
With your permission I'll update the docs for usage inside Nitro/Nuxt, because currently I don't think this is clear at all.
Describe the feature
I believe I'm close to having it working, will PR soon if nobody else does.
Runs the tests fine, I have visual output in browser with Drizzle Studio.
I started running some quick Nuxt 3 tests with forked builds of db0.
Also noticed there are multiple ways to go by this... .
The connector runs on
./libsql/node
and relies onurl
andauthToken
instead of local filePath. The way I went about it is just by creating a./libsql/turso.ts
version of./libsql/node
. You could technically do the same if the 'file:' prefix wasnt hardcoded for local dev db's.From a Full Stack development pov, I would personally love to automagically detect wether your running
better-sqlite3
locally by simply ommitting or including your Turso .env variables.Here's an example just using db0:
Here's basic config with Nuxt 3 / Nitro
Basic usecase in Nuxt 3/ Nitro
Experimental route Nuxt 3/ Nitro/ db0
./server/utils/db.ts
Would love to see this happen! Even sounds catchy like, Drizzle... UseDatabase!!
Additional information
The text was updated successfully, but these errors were encountered: