New features
Thanks to amazing contributions from @kevinmichaelchen in #274, you can now override types on a global level:
.kysely-codegenrc.json
{
"customImports": {
"InstantRange": "./custom-types",
"CustomDuration": "@my-org/custom-types#Duration",
"Temporal": "@js-temporal/polyfill",
},
"typeMapping": {
"timestamptz": "Temporal.Instant",
"tstzrange": "InstantRange",
"date": "Temporal.PlainDate",
"interval": "CustomDuration"
}
}
Example of generated output:
import type { InstantRange } from './custom-types';
import type { Duration as CustomDuration } from '@my-org/custom-types';
import type { Temporal } from '@js-temporal/polyfill';
export interface EventModel {
createdAt: Temporal.Instant;
dateRange: ColumnType<InstantRange, InstantRange, never>;
eventDate: Temporal.PlainDate;
interval: CustomDuration;
}
export interface DB {
events: EventModel;
}
What's Changed
- fix(GH-240): crash caused by undeclared dependency by @FaberVitale in #241
- chore(deps): allow kysely 0.28.0 and tedious 19 by @belgattitude in #256
- feat: export config types by @Omar-Awawdeh in #252
- chore(pnpm): pnpm v10.9.0, set onlyBuiltDependencies by @belgattitude in #254
- README: Pin @tediousjs/connection-string to 0.5.0 by @yuriy-sng in #279
- Fix peer dep range by @joefatora in #268
- Add missing cli arg "config-file" to documentation by @SimonSimCity in #263
- Fix inconsistencies between VS Code settings and Prettier configuration by @anonpay-sh in #265
- feat: Support imports for custom types by @kevinmichaelchen in #274
New Contributors
- @FaberVitale made their first contribution in #241
- @belgattitude made their first contribution in #256
- @Omar-Awawdeh made their first contribution in #252
- @yuriy-sng made their first contribution in #279
- @joefatora made their first contribution in #268
- @SimonSimCity made their first contribution in #263
- @anonpay-sh made their first contribution in #265
- @kevinmichaelchen made their first contribution in #274
Full Changelog: 0.18.0...0.19.0