drizzle-team / drizzle-team/drizzle-orm

[FEATURE]: Add support for sqlcommenter

Open
#2,147 3 comments 27 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Describe what you want

> 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.

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):
```
const result = await db.select().from(users).comment({ hello: "world" });
const result = await db.select().from(users).tag({ foo: "bar" });
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.