Type alias HasOneSetAssociationMixin<T, TModelPrimaryKey>

HasOneSetAssociationMixin<T, TModelPrimaryKey>: {
    (newAssociation, options?): Promise<null>;
    (newAssociation, options?): Promise<T>;
}

The setAssociation mixin applied to models with hasOne. An example of usage is as follows:

class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> {
declare setRole: HasOneSetAssociationMixin<Role, Role['id']>;
}

User.hasOne(Role);

Type Parameters

  • T extends Model
  • TModelPrimaryKey

Type declaration

See

Model.hasOne