Theo's Typesafe CultTTC
Theo's Typesafe Cult2y ago
3 replies
Dari

Is it bad to get db without context?

Hey, i was doing some code splitting in my create-t3-turbo app.

I found out that i can access the (drizzle) db client without the context.
So instead of ctx.db i just imported db from '@acme/db'.

I was wondering if there is a downside to this approach and why db was added to the context then?
It certainly makes my code cleaner because i don't have to pass the db client to functions.
Was this page helpful?