You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using sequelize-typescript in my project. To define a model, I create two separate classes: an entity class and a model class:
// Entity classclassUser{username: string;fullName: string;}// Model class
@Table({tableName: "user"})classUserModelextendsModelimplementsUser{
@Columnusername: string;
@ColumnfullName: string;}
I do this in order to separate my entitiy's interfaces from sequelize model's interface (using in repository pattern). It's a bit inconvinient since I have to do the declaring job twice.
So can we integrate extends Model to @Table decorator? So that I only have to define everything in Entity classes. For example:
I'm using
sequelize-typescript
in my project. To define a model, I create two separate classes: an entity class and a model class:I do this in order to separate my entitiy's interfaces from sequelize model's interface (using in repository pattern). It's a bit inconvinient since I have to do the declaring job twice.
So can we integrate
extends Model
to@Table
decorator? So that I only have to define everything in Entity classes. For example:The text was updated successfully, but these errors were encountered: