Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BulkCreateOptions<TAttributes>

Options for Model.bulkCreate method

Type parameters

  • TAttributes = any

Hierarchy

Index

Properties

benchmark?: boolean

Pass query execution time in milliseconds as second argument to logging function (options.logging).

fields?: keyof TAttributes[]

Fields to insert (defaults to all fields)

hooks?: boolean

If false the applicable hooks will not be called. The default value depends on the context.

default

true

ignoreDuplicates?: boolean

Ignore duplicate values for primary keys?

default

false

Include options. See find for details

individualHooks?: boolean

Run before / after create hooks for each individual Instance? BulkCreate hooks will still be run if BulkCreateOptions.hooks is true.

default

false

logging?: boolean | ((sql: string, timing?: number) => void)

A function that gets executed while running the query to log the sql.

returning?: boolean | keyof TAttributes[]

Return all columns or only the specified columns for the affected rows (only for postgres)

searchPath?: string

An optional parameter to specify the schema search_path (Postgres only)

transaction?: null | Transaction

The transaction in which this query must be run.

If CLS is enabled and a transaction is running in the current CLS context, that transaction will be used, unless null or a Transaction is manually specified here.

updateOnDuplicate?: keyof TAttributes[]

Fields to update if row key already exists (on duplicate key update)? (only supported by MySQL, MariaDB, SQLite >= 3.24.0 & Postgres >= 9.5).

validate?: boolean

Should each row be subject to validation before it is inserted. The whole insert will fail if one row fails validation

default

false

Generated using TypeDoc