Skip to content

postgrelize / BelongsToManyCreateAssociationMixinOptions

Interface: BelongsToManyCreateAssociationMixinOptions ​

Defined in: src/associations/mixin-types.ts:288

Options of the createX accessor of a belongsToMany association (Sequelize v6).

Example ​

ts
const options: BelongsToManyCreateAssociationMixinOptions = { through: { role: 'member' } };

Extends ​

Properties ​

benchmark? ​

optional benchmark?: boolean

Defined in: src/model/runtime.ts:17

Pass query duration to the logger.

Inherited from ​

CreateOptions.benchmark


fields? ​

optional fields?: readonly any[]

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 ​

CreateOptions.fields


hooks? ​

optional hooks?: boolean

Defined in: src/model/write-options.ts:34

Run lifecycle hooks.

Default Value ​

ts
true

Inherited from ​

CreateOptions.hooks


include? ​

optional include?: IncludeOption

Defined in: src/model/write-options.ts:67

Create associated rows from nested values (Sequelize v6).

Inherited from ​

CreateOptions.include


logging? ​

optional logging?: false | LoggingFunction

Defined in: src/model/runtime.ts:15

SQL logger for this query, or false.

Inherited from ​

CreateOptions.logging


onConflict? ​

optional onConflict?: Readonly<{ action: "nothing" | Readonly<{ update: OnConflictUpdate<any>; where?: WhereOptions<any>; }>; target?: OnConflictTarget<any>; }>

Defined in: src/model/write-options.ts:65

postgrelize extension

Advanced ON CONFLICT handling. PostgreSQL extension.

Inherited from ​

CreateOptions.onConflict


overriding? ​

optional overriding?: "user" | "system"

Defined in: src/model/write-options.ts:42

postgrelize extension

OVERRIDING SYSTEM VALUE / OVERRIDING USER VALUE for identity columns. PostgreSQL extension.

Inherited from ​

CreateOptions.overriding


replacements? ​

optional replacements?: 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 ​

CreateOptions.replacements


retry? ​

optional retry?: Readonly<{ backoffBase?: number; backoffExponent?: number; backoffJitter?: number; match?: readonly RetryMatch[]; 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 ​

CreateOptions.retry


returning? ​

optional returning?: 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 ​

ts
true

Inherited from ​

CreateOptions.returning


silent? ​

optional silent?: boolean

Defined in: src/model/write-options.ts:28

Do not update updatedAt.

Default Value ​

ts
false

Inherited from ​

CreateOptions.silent


statementTimeout? ​

optional statementTimeout?: number

Defined in: src/model/runtime.ts:25

postgrelize extension

statement_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 ​

CreateOptions.statementTimeout


through? ​

optional through?: JoinTableAttributes

Defined in: src/associations/mixin-types.ts:290

Attributes of the junction row.


transaction? ​

optional transaction?: Transaction | null

Defined in: src/model/runtime.ts:13

Transaction to run in; null forces running outside the CLS transaction.

Inherited from ​

CreateOptions.transaction


useMaster? ​

optional useMaster?: boolean

Defined in: src/model/runtime.ts:36

postgrelize extension

Force the writer even for SELECTs when read replicas are configured. postgrelize extension.

Inherited from ​

CreateOptions.useMaster


validate? ​

optional validate?: boolean

Defined in: src/model/write-options.ts:37

Run validations.

Default Value ​

true (false for bulkCreate)

Inherited from ​

CreateOptions.validate

Released under the MIT License.