Can someone please explain me what is happening in this code...
I need to pass D1Database client (Drizzle ORM) to the Context of trpc-nuxt handler.
The docs here https://orm.drizzle.team/docs/installation-and-db-connection/sqlite/d1 says that this is the way... but what is happening here? Is the D1Database client passing as a type of the interface in env parameter?
My problem is that I cant add env: Env parameter to the context, because handler expects only 1 paramter and throws TS error. Is there another way to pass D1Database client to the context?
Demo project:
https://github.com/juretopolak/trpc-nuxt/blob/main/server/trpc/context.ts