What are the benefits of adding db to context rather than importing it directly in the router?
As per title, the docs and most examples I've seen using TRPC put the database into context as follows,
can anyone explain what the actual benefit of this is over just importing it in the routers like below?
I'm sure there must be some reasoning so I want to make sure I don't require a needless refactoring later on.
Thanks!
Michael
1 Reply
it's a matter of preference. don't think there is any benefit or loss in either approach.