Making Updateable<X> fields required
Excuse me if this has already been posted, but I recently turned on strict mode after completing my migration to TS and I'm struggling to make certain fields required when updating an entity.
When I hover over
UpdateableActivity
it shows:
but hovering over Updateable
shows:
if possible I'd like it to be something like:
https://kyse.link/MA3jQ is my playground link if that helps!Solution:Jump to solution
You can't make them required by kysely. In SQL update statements, every column is optional.
You can have your own interface that makes some fields required and use that as an input for your own update functions that use kysely....
3 Replies
Solution
You can't make them required by kysely. In SQL update statements, every column is optional.
You can have your own interface that makes some fields required and use that as an input for your own update functions that use kysely.
You can use a helper like this for example https://kyse.link/wvDvg
That makes sense.
On the same subject, how come that for my own
UpdateableActivity
the fields have | undefined
, but when hovering over Updateable
there's no | undefined
in the example