sqlcommenter is a suite of middlewares/plugins that enable your ORMs to augment SQL statements before execution, with comments containing information about the code that caused its execution. This helps in easily correlating slow performance with source code and giving insights into backend database performance. In short it provides some observability into the state of your client-side applications and their impact on the database’s server-side.
This can be achieved today with Drizzle on manual sql queries, but there is no way to use the native Drizzle selectors. Adding sqlcommenter would make easier to tag those, even though it's an "opinionated" library mostly used in Google Cloud.
Sample usage (options):
const result = await db.select().from(users).comment({ hello: "world" });
const result = await db.select().from(users).tag({ foo: "bar" });
Describe what you want
https://google.github.io/sqlcommenter/
This can be achieved today with Drizzle on manual
sql
queries, but there is no way to use the native Drizzle selectors. Adding sqlcommenter would make easier to tag those, even though it's an "opinionated" library mostly used in Google Cloud.Sample usage (options):