BluePin
“Integrating Drizzle Prepared Statements with tRPC Context”
I’m currently using tRPC and Drizzle for my project. In tRPC, we generally place the database driver in the context, which allows us to call this variable from within the context and create queries with Drizzle, among other ORMs. This is possible because the database is within the context.
Drizzle has a feature called Prepared Statements that allows me to speed up queries by creating queries with placeholders. This significantly accelerates the query as the SQL binary is already ready and the ORM doesn’t have to pass the logic to the Query Builder, skipping some processing steps.
4 replies