client-ts icon indicating copy to clipboard operation
client-ts copied to clipboard

Variadic types for return vs create

Open SferaDev opened this issue 2 years ago • 1 comments

When we add Dates support we can consider:

ColumnType<Date, Date | string>

Where we type on fn returns Date. But also accept strings in create/update.

Similarly we can have a third generic for the update:

ColumnType<string, string, never>

Which is useful for IDs or protected fields. Ie. when we add multi field primary identifiers.

The spec would be:

ColumnType<Return, Create = Return, Update = Create>

SferaDev avatar May 14 '22 07:05 SferaDev

@SferaDev has this already been done. If not I've marked as P2 - please feel free to change it if that's not right.

richardgill avatar Dec 28 '22 09:12 richardgill