The getAssociation mixin applied to models with hasOne. An example of usage is as follows:
class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> { declare getRole: HasOneGetAssociationMixin<Role>;}User.hasOne(Role); Copy
class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> { declare getRole: HasOneGetAssociationMixin<Role>;}User.hasOne(Role);
Optional
The associated model, or null if no model is associated. HasOne associations are always nullable because the foreign key is on the target model.
Model.hasOne
Generated using TypeDoc
The getAssociation mixin applied to models with hasOne. An example of usage is as follows: