drizzle-team / drizzle-team/drizzle-orm
[FEATURE]: Support table / column comments in schema & migrations (drizzle-kit)
- Dominant language
- TypeScript
- Stars
- 35.8k
- Forks
- 1.6k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 4
Description
### Feature hasn't been suggested before.
- [x] I have verified this feature I'm about to request hasn't been suggested before.
### Describe the enhancement you want to request
# Feature description
Currently, Drizzle ORM schema definitions do not provide a first-class way to define table comments and column comments that can be managed through drizzle-kit migrations.
In modern projects, database comments are no longer only for humans — they are increasingly important machine-readable context for AI-powered tooling.
I would like to request native support for defining and migrating comments directly in the schema layer.
# example API
```TypeScript
export const users = pgTable(
'users',
{
id: uuid('id').primaryKey().comment('Primary key'),
email: text('email').notNull().comment('User email address'),
createdAt: timestamp('created_at')
.notNull()
.defaultNow()
.comment('Account creation time'),
},
{
comment: 'Application users table',
}
);
```
# PostgreSQL example
```sql
COMMENT ON TABLE users IS 'Application users table';
COMMENT ON COLUMN users.email IS 'User email address';
```
Contributor guide
Assessment
This issue has not been assessed yet.