K
Kysely2y ago
vicary

How do Date columns works?

I am learning Kysely from the website, at the getting started section I can see the following line:
modified_at: ColumnType<Date, string | undefined, never>
modified_at: ColumnType<Date, string | undefined, never>
But ColumnType is type-only and should not affect runtime conversion, how does Kysely knows when to convert the data into Date in runtime?
6 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Kristian Notari
this should be correct keep in mind that you could end up having Date as select type but string as insert/update type, cause maybe you're passing strings for insertion (it depends on how you configure the conversion on the driver)
Igal
Igal2y ago
pg supports custom result transformation using pg-types. mysql2 has a similar capability.
vicary
vicaryOP2y ago
We use Aurora Serverless because of AppSync, it seems aws-sdk v3 has no post-selection type conversions.
Igal
Igal2y ago
Are you using kysely-data-api?
vicary
vicaryOP2y ago
Yes
Want results from more Discord servers?
Add your server