mirror of
https://github.com/theoludwig/kysely-typegen.git
synced 2026-10-09 21:20:04 +02:00
feat: generate JSDoc from column comments
This commit is contained in:
6 files changed
+74
-3
No files matched your search
@@ -168,6 +168,19 @@ const rows = await database.selectFrom("User").selectAll().execute()
|
||||
|
||||
Fully type-safe queries derived from your actual database schema.
|
||||
|
||||
### Column comments
|
||||
|
||||
Column comments (`COMMENT ON COLUMN` in PostgreSQL, `COMMENT '...'` in MySQL) are emitted as JSDoc above the column, so they show up in your editor on hover:
|
||||
|
||||
```ts
|
||||
export interface Users {
|
||||
/** Contact email address. */
|
||||
email: string | null
|
||||
}
|
||||
```
|
||||
|
||||
SQLite has no column comments, so none are generated.
|
||||
|
||||
## Extending to other database dialects
|
||||
|
||||
`kysely-typegen` ships with `KyselyTypegenPostgresDialect`, `KyselyTypegenMySQLDialect`, and `KyselyTypegenSQLiteDialect`, but you can add support for any database by extending the abstract `KyselyTypegenDialect` class.
|
||||
|
||||
Reference in new issue
Block a user