Repository navigation
[FEATURE]: Insert type without columns that have defaults #6655
hyunbinseo
started this conversation in
Ideas
Replies: 1 comment
|
👋 I moved it to discussions so it is not hidden in issues |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Feature hasn't been suggested before.
Describe the enhancement you want to request
$inferInsertkeeps columns with defaults (e.g..default(),$defaultFn(),$onUpdate()) as optional keys, which also lets callers override them:Omit<typeof post.$inferInsert, 'id' | 'createdAt'>works, but drifts: a default added later stays overridable without a type error.Request: an insert type that omits every column with
hasDefault: true— including$onUpdate(), generated, and identity columns. Either as anInferInsertModeloption, next tooverride:Or as a table property, next to
$inferInsert:Current workaround, tested on
1.0.0-rc.5:cc @CheHyeonYeong
All reactions