postgrelize / BelongsToManyHasAssociationMixinOptions
Interface: BelongsToManyHasAssociationMixinOptions ​
Defined in: src/associations/mixin-types.ts:321
Options of the hasX accessor of a belongsToMany association (Sequelize v6).
Example ​
const options: BelongsToManyHasAssociationMixinOptions = { transaction };Extends ​
Properties ​
attributes? ​
optionalattributes?:FindAttributeOptions
Defined in: src/model/select-options.ts:80
Selected attributes. All attributes when omitted.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.attributes
benchmark? ​
optionalbenchmark?:boolean
Defined in: src/model/runtime.ts:17
Pass query duration to the logger.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.benchmark
distinctOn? ​
optionaldistinctOn?: readonlyunknown[]
Defined in: src/model/select-options.ts:104
postgrelize extensionSELECT DISTINCT ON (...): attributes or expressions. PostgreSQL extension.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.distinctOn
from? ​
readonlyoptionalfrom?:Readonly<Record<string,FromSourceOption>>
Defined in: src/model/cte-builder.ts:104
postgrelize extensionExtra relations (FROM "Model", "alias"), keyed by alias; correlate them in where. PostgreSQL extension.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.from
group? ​
optionalgroup?:unknown
Defined in: src/model/select-options.ts:84
GROUP BY attributes or expressions.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.group
having? ​
optionalhaving?:unknown
Defined in: src/model/select-options.ts:86
HAVING condition.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.having
hooks? ​
optionalhooks?:boolean
Defined in: src/model/find-options.ts:68
Run beforeFind / afterFind hooks.
Default Value ​
trueInherited from ​
BelongsToManyGetAssociationsMixinOptions.hooks
include? ​
optionalinclude?:IncludeOption
Defined in: src/model/find-options.ts:70
Eager-load associations through JOINs (or separate queries for separate includes).
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.include
joinTableAttributes? ​
optionaljoinTableAttributes?:FindAttributeOptions
Defined in: src/associations/mixin-types.ts:221
Junction attributes to select.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.joinTableAttributes
limit? ​
optionallimit?:number|null
Defined in: src/model/select-options.ts:88
Maximum number of rows; null or undefined for no limit.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.limit
lock? ​
optionallock?:LockOption
Defined in: src/model/select-options.ts:92
Row lock (FOR UPDATE etc.); requires a transaction.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.lock
logging? ​
optionallogging?:false|LoggingFunction
Defined in: src/model/runtime.ts:15
SQL logger for this query, or false.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.logging
nest? ​
optionalnest?:boolean
Defined in: src/model/find-options.ts:56
With raw, build nested objects from dotted keys such as 'posts.title'.
Default Value ​
falseInherited from ​
BelongsToManyGetAssociationsMixinOptions.nest
noWait? ​
optionalnoWait?:boolean
Defined in: src/model/select-options.ts:99
postgrelize extensionAdd NOWAIT to the row lock so the query fails instead of waiting; only with lock. PostgreSQL extension.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.noWait
offset? ​
optionaloffset?:number|null
Defined in: src/model/select-options.ts:90
Number of rows to skip; null or undefined to skip none.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.offset
order? ​
optionalorder?: readonlyunknown[] |Order
Defined in: src/model/select-options.ts:82
Sort order: attribute names, [attribute, 'ASC' | 'DESC'] pairs or expressions.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.order
paranoid? ​
optionalparanoid?:boolean
Defined in: src/model/find-options.ts:65
For paranoid models: false includes soft-deleted rows.
Default Value ​
trueInherited from ​
BelongsToManyGetAssociationsMixinOptions.paranoid
plain? ​
optionalplain?:boolean
Defined in: src/model/find-options.ts:59
Return a single row instead of an array (set internally by findOne).
Default Value ​
falseInherited from ​
BelongsToManyGetAssociationsMixinOptions.plain
raw? ​
optionalraw?:boolean
Defined in: src/model/find-options.ts:53
Return plain row objects instead of model instances.
Default Value ​
falseInherited from ​
BelongsToManyGetAssociationsMixinOptions.raw
rejectOnEmpty? ​
optionalrejectOnEmpty?:boolean|Error
Defined in: src/model/find-options.ts:62
Throw EmptyResultError (or the given Error) when no row is found.
Default Value ​
falseInherited from ​
BelongsToManyGetAssociationsMixinOptions.rejectOnEmpty
replacements? ​
optionalreplacements?:Replacements
Defined in: src/model/runtime.ts:43
Values of ? (array) or :name (object) placeholders written in raw SQL inside the options (where: literal('"a" = :a'), attributes: [[literal(...), 'x']]), as in Sequelize v6. Every value is sent as a bound parameter, never concatenated into the SQL text; arrays expand to a comma separated list of parameters.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.replacements
retry? ​
optionalretry?:Readonly<{backoffBase?:number;backoffExponent?:number;backoffJitter?:number;match?: readonlyRetryMatch[];max?:number;name?:string;report?: (message,options,error?) =>void;timeout?:number; }>
Defined in: src/model/runtime.ts:31
Retries this query when it fails, merged over the instance retry option (Sequelize v6). The connection acquisition is part of the retried work; a query that runs in a transaction is never retried.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.retry
sample? ​
optionalsample?:Readonly<{method:"BERNOULLI"|"SYSTEM";percent:number;seed?:number; }>
Defined in: src/model/select-options.ts:115
postgrelize extensionRead only a random sample of the model table (TABLESAMPLE). PostgreSQL extension.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.sample
scope? ​
optionalscope?:string|boolean
Defined in: src/associations/mixin-types.ts:223
Scope to apply on the associated model, or false to remove its default scope.
Inherited from ​
BelongsToManyHasAssociationMixinOptions.scope
skipLocked? ​
optionalskipLocked?:boolean
Defined in: src/model/select-options.ts:94
Add SKIP LOCKED to the row lock; only with lock.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.skipLocked
source? ​
readonlyoptionalsource?:string|Subquery
Defined in: src/model/cte-builder.ts:99
postgrelize extensionRead model rows from this relation instead of the model table: a CTE or table name, or a subquery such as a set operation (a.union(b)), aliased with the model name. Columns are named like the attributes. PostgreSQL extension.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.source
statementTimeout? ​
optionalstatementTimeout?:number
Defined in: src/model/runtime.ts:25
postgrelize extensionstatement_timeout for this query only, in milliseconds (non-negative integer; 0 disables it). PostgreSQL cancels the statement with a DatabaseError (code 57014) when it runs longer. Outside a transaction the query runs in its own short transaction; inside one the previous timeout is restored afterwards. PostgreSQL extension.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.statementTimeout
subQuery? ​
optionalsubQuery?:boolean
Defined in: src/model/find-options.ts:72
false disables the sub-query used for limit combined with multi-row includes.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.subQuery
tableAs? ​
optionaltableAs?:string
Defined in: src/model/find-options.ts:77
Alias of the main table in FROM instead of the model name, so literals and col('alias.x') can refer to it (a v6 internal option that v6's typings omit). Ignored when include is set.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.tableAs
transaction? ​
optionaltransaction?:Transaction|null
Defined in: src/model/runtime.ts:13
Transaction to run in; null forces running outside the CLS transaction.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.transaction
useMaster? ​
optionaluseMaster?:boolean
Defined in: src/model/runtime.ts:36
postgrelize extensionForce the writer even for SELECTs when read replicas are configured. postgrelize extension.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.useMaster
where? ​
optionalwhere?:WhereOptions<any>
Defined in: src/model/find-options.ts:50
Filter rows; see WhereOptions. All rows when omitted.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.where
with? ​
readonlyoptionalwith?:Readonly<Record<string,Subquery|WriteStatement|Readonly<{cycle?:Readonly<{columns: readonlystring[];set:string;using:string; }>;materialized?:boolean;query:Subquery|WriteStatement;recursive?:Subquery;search?:Readonly<{by: readonlystring[];mode?:"breadth"|"depth";set:string; }>;unionAll?:boolean; }>>>
Defined in: src/model/cte-builder.ts:92
postgrelize extensionCommon table expressions (WITH [RECURSIVE] ...). PostgreSQL extension.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.with
withTies? ​
optionalwithTies?:boolean
Defined in: src/model/select-options.ts:110
postgrelize extensionFETCH FIRST limit ROWS WITH TIES instead of LIMIT: also returns the rows that tie with the last one on the order columns. Needs limit and order. PostgreSQL extension.
Inherited from ​
BelongsToManyGetAssociationsMixinOptions.withTies