Is there any way how to get an interface for a model columns? For example, i have this model:
class User extends BaseModel {
email: string;
password: string;
}
And i would like to get this model as an interface, but right now the model is extended by the BaseModel, so additionally types such as findBy are added into the interface. Is there any way, how to get only the columns? I was lookin into the types, but i did not find anything.
Use case would be something like: I want to edit some of the columns, so i would have some update method and i want to use the type as a type of an argument for this method:
update(user: Partial<User['Columns']>) {
... My code
}
Hi,
Is there any way how to get an interface for a model columns? For example, i have this model:
And i would like to get this model as an interface, but right now the model is extended by the BaseModel, so additionally types such as
findBy
are added into the interface. Is there any way, how to get only the columns? I was lookin into the types, but i did not find anything.Use case would be something like: I want to edit some of the columns, so i would have some update method and i want to use the type as a type of an argument for this method:
Thank you and have a nice day!