What am I not understanding about ColumnType?
(Apologize if this is very nooby I am new to kysely as of today)
Used kysely-codegen and it spit out something like the following:
(Maybe it shouldn't be Generated? My current thought is code-gen marks that because the column has a default value? I'm struggling to find in kysely docs clear right/wrong here.)
Which I then wrap:
However when I go to use like so:
I get compilation error:
----------------
If I understand how codegen set up Int8 correctly with ColumnType then it passed as the InsertType (middle arg). So I wouldn't expect this to error - what am I missing here?
Solution:Jump to solution
So I figured out through combing through kysely-codegen closed issues that there is a differnece between the out-of-the-box kysely Generated type and the Generated type I was removing (that I thought was extra) that gets generated with codegen. When I restored for the codegen one the compilation issue went away.
For reference current codegen type:
```export type Generated<T> = T extends ColumnType<infer S, infer I, infer U>
? ColumnType<S, I | undefined, U>...
1 Reply
Solution
So I figured out through combing through kysely-codegen closed issues that there is a differnece between the out-of-the-box kysely Generated type and the Generated type I was removing (that I thought was extra) that gets generated with codegen. When I restored for the codegen one the compilation issue went away.
For reference current codegen type:
I dismissed the bot response before so I can't see how to mark this solved now.