IncludeBuilder<T> class Associations

Builder for creating type-safe include configurations.

This class provides a type-safe way to configure includes with all Sequelize options.

Constructors

IncludeBuilder({String? association, ModelInterface? model, bool? all, bool? nested, bool? separate = false, bool? required, bool? right, dynamic where, QueryAttributes? attributes, dynamic order, dynamic group, int? limit, int? offset, dynamic include, Map<String, dynamic>? through, bool? duplicating, dynamic on, bool? or, bool? subQuery, bool? paranoid})

Properties

all bool?
If true, includes all associations of the model
final
association String?
The association name (null when all: true)
final
attributes QueryAttributes?
Select specific attributes from the associated model
final
duplicating bool?
Mark the include as duplicating, will prevent a subquery from being used
final
group → dynamic
Group the associated records
final
hashCode int
The hash code for this object.
no setterinherited
include → dynamic
Nested includes (associations of the associated model) Can be a List<IncludeBuilder> or a function that returns List<IncludeBuilder> Supports infinite levels of nesting - each IncludeBuilder can contain more IncludeBuilders
final
limit int?
Limit the number of associated records (requires separate: true)
final
model → ModelInterface?
The associated model instance (null when all: true)
final
nested bool?
If true, includes all nested associations recursively (requires all: true)
final
offset int?
Offset for pagination (requires separate: true)
final
on → dynamic
Custom ON clause, overrides default
final
or bool?
Whether to bind the ON and WHERE clause together by OR instead of AND @default false
final
order → dynamic
Order the associated records
final
paranoid bool?
If false, includes soft-deleted records for paranoid models @default true (excludes soft-deleted records)
final
required bool?
If true, performs INNER JOIN (only returns parent with matching associations)
final
If true, performs RIGHT OUTER JOIN (requires required: false)
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
separate bool?
If true, runs a separate query (useful for HasMany/BelongsToMany)
final
subQuery bool?
Use sub queries. This should only be used if you know for sure the query does not result in a cartesian product
final
through Map<String, dynamic>?
Options for BelongsToMany through models
final
where → dynamic
Filter conditions for the associated model Can be a QueryOperator directly or a function that will be resolved later
final

Methods

copyWith({String? association, ModelInterface? model, bool? all, bool? nested, bool? separate, bool? required, bool? right, dynamic where, QueryAttributes? attributes, dynamic order, dynamic group, int? limit, int? offset, dynamic include, Map<String, dynamic>? through, bool? duplicating, dynamic on, bool? or, bool? subQuery, bool? paranoid}) IncludeBuilder<T>
Create a copy of this IncludeBuilder with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Convert the include builder to JSON format for Sequelize
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited