add generic interface support for tableSchema function#1437
add generic interface support for tableSchema function#1437onursagir wants to merge 1 commit intoNozbe:masterfrom
Conversation
|
Alternatively one could go with an approach like this. Which is nice because it would require the user to provide all the keys present in the interface however one downside is that it would also require that they are provided in reverse order. Let me know what you think I can update the pr accordingly |
|
@onursagir Looks neat! Is it required to provide the type parameter after this change? In other words, will existing code continue to work without typing out table schemas? |
|
@radex No I don't think so, the type falls back to unknown if none is provided. |
|
@onursagir In this case I'm cool with merging it, but please add a note to CHANGELOG-Unreleased |
|
@radex which variant would you prefer
|
|
@onursagir Stricter is better IMO |
|
@radex I'll update this pr over the weekend accordingly I will ping you when it's ready again |
|
@onursagir Hey, any updates? |
Added an optional generic for the
tableSchemafunction this allows for project using Typescript to show mistakes when creating a schema for example:Alos forces you to provide
isOptional: trueif the property is nullable