-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add generic interface support for tableSchema function #1437
base: master
Are you sure you want to change the base?
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
tableSchema
function this allows for project using Typescript to show mistakes when creating a schema for example:Alos forces you to provide
isOptional: true
if the property is nullable