Type alias HasManySetAssociationsMixin<T, TModelPrimaryKey>

HasManySetAssociationsMixin<T, TModelPrimaryKey>: ((newAssociations?, options?) => Promise<void>)

The setAssociations mixin applied to models with hasMany. An example of usage is as follows:

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

User.hasMany(Role);

Type Parameters

  • T extends Model
  • TModelPrimaryKey

Type declaration

See

Model.hasMany