postgrelize / BelongsToManyAddAssociationsMixinOptions
Interface: BelongsToManyAddAssociationsMixinOptions ​
Defined in: src/associations/mixin-types.ts:252
Options of the addXs accessor of a belongsToMany association (Sequelize v6).
Example ​
const options: BelongsToManyAddAssociationsMixinOptions = { through: { role: 'member' } };Extends ​
Properties ​
attributes? ​
optionalattributes?:FindAttributeOptions
Defined in: src/model/select-options.ts:80
Selected attributes. All attributes when omitted.
Inherited from ​
FindOptions.attributes
benchmark? ​
optionalbenchmark?:boolean
Defined in: src/model/runtime.ts:17
Pass query duration to the logger.
Inherited from ​
FindOptions.benchmark
conflictAttributes? ​
optionalconflictAttributes?: readonlystring[]
Defined in: src/model/bulk-options.ts:48
Conflict target attributes for updateOnDuplicate. Default: first unique key, else primary key.
Inherited from ​
BulkCreateOptions.conflictAttributes
conflictWhere? ​
optionalconflictWhere?:WhereOptions<any>
Defined in: src/model/bulk-options.ts:50
Predicate of a partial unique index used as conflict target.
Inherited from ​
BulkCreateOptions.conflictWhere
distinctOn? ​
optionaldistinctOn?: readonlyunknown[]
Defined in: src/model/select-options.ts:104
postgrelize extensionSELECT DISTINCT ON (...): attributes or expressions. PostgreSQL extension.
Inherited from ​
FindOptions.distinctOn
fields? ​
optionalfields?: readonlyany[]
Defined in: src/model/write-options.ts:24
Attributes to save; others are ignored. Default: all changed attributes. Mutable so hooks can adjust it, as in v6.
Inherited from ​
BulkCreateOptions.fields
force? ​
optionalforce?:boolean
Defined in: src/model/bulk-options.ts:195
For paranoid models: delete the row instead of setting deletedAt.
Default Value ​
falseInherited from ​
InstanceDestroyOptions.force
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 ​
FindOptions.from
group? ​
optionalgroup?:unknown
Defined in: src/model/select-options.ts:84
GROUP BY attributes or expressions.
Inherited from ​
FindOptions.group
having? ​
optionalhaving?:unknown
Defined in: src/model/select-options.ts:86
HAVING condition.
Inherited from ​
FindOptions.having
hooks? ​
optionalhooks?:boolean
Defined in: src/model/find-options.ts:68
Run beforeFind / afterFind hooks.
Default Value ​
trueInherited from ​
FindOptions.hooks
ignoreDuplicates? ​
optionalignoreDuplicates?:boolean
Defined in: src/model/bulk-options.ts:39
Add ON CONFLICT DO NOTHING, skipping rows that violate a unique constraint.
Default Value ​
falseInherited from ​
BulkCreateOptions.ignoreDuplicates
include? ​
optionalinclude?:IncludeOption
Defined in: src/model/find-options.ts:70
Eager-load associations through JOINs (or separate queries for separate includes).
Inherited from ​
FindOptions.include
individualHooks? ​
optionalindividualHooks?:boolean
Defined in: src/model/bulk-options.ts:42
Run per-instance create hooks (rows are then inserted one by one, like v6).
Default Value ​
falseInherited from ​
BulkCreateOptions.individualHooks
limit? ​
optionallimit?:number|null
Defined in: src/model/select-options.ts:88
Maximum number of rows; null or undefined for no limit.
Inherited from ​
FindOptions.limit
lock? ​
optionallock?:LockOption
Defined in: src/model/select-options.ts:92
Row lock (FOR UPDATE etc.); requires a transaction.
Inherited from ​
FindOptions.lock
logging? ​
optionallogging?:false|LoggingFunction
Defined in: src/model/runtime.ts:15
SQL logger for this query, or false.
Inherited from ​
FindOptions.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 ​
FindOptions.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 ​
FindOptions.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 ​
FindOptions.offset
onConflict? ​
optionalonConflict?:Readonly<{action:"nothing"|Readonly<{update:OnConflictUpdate<any>;where?:WhereOptions<any>; }>;target?:OnConflictTarget<any>; }>
Defined in: src/model/bulk-options.ts:55
postgrelize extensionAdvanced ON CONFLICT handling; cannot be combined with the options above. PostgreSQL extension.
Inherited from ​
BulkCreateOptions.onConflict
order? ​
optionalorder?: readonlyunknown[] |Order
Defined in: src/model/select-options.ts:82
Sort order: attribute names, [attribute, 'ASC' | 'DESC'] pairs or expressions.
Inherited from ​
FindOptions.order
overriding? ​
optionaloverriding?:"user"|"system"
Defined in: src/model/write-options.ts:42
postgrelize extensionOVERRIDING SYSTEM VALUE / OVERRIDING USER VALUE for identity columns. PostgreSQL extension.
Inherited from ​
BulkCreateOptions.overriding
paranoid? ​
optionalparanoid?:boolean
Defined in: src/model/find-options.ts:65
For paranoid models: false includes soft-deleted rows.
Default Value ​
trueInherited from ​
FindOptions.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 ​
FindOptions.plain
raw? ​
optionalraw?:boolean
Defined in: src/model/find-options.ts:53
Return plain row objects instead of model instances.
Default Value ​
falseInherited from ​
FindOptions.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 ​
FindOptions.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 ​
FindOptions.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 ​
FindOptions.retry
returning? ​
optionalreturning?:boolean
Defined in: src/model/write-options.ts:31
Return all columns after insert/update; PostgreSQL always uses RETURNING, so this is accepted for v6 compatibility.
Default Value ​
trueInherited from ​
BulkCreateOptions.returning
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 ​
FindOptions.sample
silent? ​
optionalsilent?:boolean
Defined in: src/model/write-options.ts:28
Do not update updatedAt.
Default Value ​
falseInherited from ​
BulkCreateOptions.silent
skipLocked? ​
optionalskipLocked?:boolean
Defined in: src/model/select-options.ts:94
Add SKIP LOCKED to the row lock; only with lock.
Inherited from ​
FindOptions.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 ​
FindOptions.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 ​
FindOptions.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 ​
FindOptions.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 ​
FindOptions.tableAs
through? ​
optionalthrough?:JoinTableAttributes
Defined in: src/associations/mixin-types.ts:259
Attributes of the junction row.
transaction? ​
optionaltransaction?:Transaction|null
Defined in: src/model/runtime.ts:13
Transaction to run in; null forces running outside the CLS transaction.
Inherited from ​
FindOptions.transaction
unnest? ​
optionalunnest?:boolean
Defined in: src/model/bulk-options.ts:36
postgrelize extensionInsert with one array parameter per column (INSERT … SELECT * FROM unnest($1::type[], …)) instead of one parameter per cell, so batches are not capped by PostgreSQL's 65535 parameters. Every row must provide every column; ARRAY columns and conflict options are not supported. PostgreSQL extension.
Default Value ​
false
@postgrelizeInherited from ​
BulkCreateOptions.unnest
updateOnDuplicate? ​
optionalupdateOnDuplicate?: readonlystring[]
Defined in: src/model/bulk-options.ts:46
Attributes updated from the proposed row on conflict (DO UPDATE SET a = EXCLUDED.a).
Inherited from ​
BulkCreateOptions.updateOnDuplicate
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 ​
FindOptions.useMaster
validate? ​
optionalvalidate?:boolean
Defined in: src/model/write-options.ts:37
Run validations.
Default Value ​
true (false for bulkCreate)
Inherited from ​
BulkCreateOptions.validate
where? ​
optionalwhere?:WhereOptions<any>
Defined in: src/model/find-options.ts:50
Filter rows; see WhereOptions. All rows when omitted.
Inherited from ​
FindOptions.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 ​
FindOptions.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 ​
FindOptions.withTies