interface bulkCreateOptions {
    benchmark?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    conflictAttributes?: sequelizeFunc<undefined> | never[] | sequelizeFunc<never[]>;
    conflictWhere?: Fn | Literal | Where | Json | WhereAttributeHash<unknown> | {
        [or]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
    } | {
        [and]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
    } | {
        [not]: AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>;
    } | (Fn | Literal | Where | Json | WhereAttributeHash<unknown> | {
        [or]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
    } | {
        [and]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
    } | {
        [not]: AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>;
    })[] | sequelizeFunc<undefined> | sequelizeFunc<Fn> | sequelizeFunc<Literal> | sequelizeFunc<Where> | sequelizeFunc<Json> | sequelizeFunc<WhereAttributeHash<unknown>> | sequelizeFunc<{
        [or]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
    }> | sequelizeFunc<{
        [and]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
    }> | sequelizeFunc<{
        [not]: AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>;
    }> | sequelizeFunc<(Fn | Literal | Where | Json | WhereAttributeHash<unknown> | {
        [or]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
    } | {
        [and]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
    } | {
        [not]: AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>;
    })[]>;
    creatableFields?: customFields;
    fields?: sequelizeFunc<undefined> | never[] | sequelizeFunc<never[]>;
    hooks?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    ignoreDuplicates?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    include?: string | ModelType<any, any> | Association<Model<any, any>, Model<any, any>> | IncludeOptions | {
        all: true;
        nested?: true;
    } | Includeable[] | sequelizeFunc<undefined> | sequelizeFunc<string> | sequelizeFunc<ModelType<any, any>> | sequelizeFunc<Association<Model<any, any>, Model<any, any>>> | sequelizeFunc<IncludeOptions> | sequelizeFunc<{
        all: true;
        nested?: true;
    }> | sequelizeFunc<Includeable[]>;
    individualHooks?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    logging?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true> | ((sql, timing?) => void) | sequelizeFunc<((sql, timing?) => void)>;
    middleware?: expressFunc;
    path?: string;
    returning?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true> | never[] | sequelizeFunc<never[]>;
    searchPath?: string | sequelizeFunc<undefined> | sequelizeFunc<string>;
    updateOnDuplicate?: sequelizeFunc<undefined> | never[] | sequelizeFunc<never[]>;
    validate?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
}

Hierarchy (view full)

  • operationFieldCore
  • expressCrudProps<Omit<BulkCreateOptions<unknown>, "transaction">>
    • bulkCreateOptions

Properties

benchmark?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>

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

conflictAttributes?: sequelizeFunc<undefined> | never[] | sequelizeFunc<never[]>

Optional override for the conflict fields in the ON CONFLICT part of the query. Only supported in Postgres >= 9.5 and SQLite >= 3.24.0

conflictWhere?: Fn | Literal | Where | Json | WhereAttributeHash<unknown> | {
    [or]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
} | {
    [and]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
} | {
    [not]: AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>;
} | (Fn | Literal | Where | Json | WhereAttributeHash<unknown> | {
    [or]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
} | {
    [and]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
} | {
    [not]: AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>;
})[] | sequelizeFunc<undefined> | sequelizeFunc<Fn> | sequelizeFunc<Literal> | sequelizeFunc<Where> | sequelizeFunc<Json> | sequelizeFunc<WhereAttributeHash<unknown>> | sequelizeFunc<{
    [or]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
}> | sequelizeFunc<{
    [and]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
}> | sequelizeFunc<{
    [not]: AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>;
}> | sequelizeFunc<(Fn | Literal | Where | Json | WhereAttributeHash<unknown> | {
    [or]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
} | {
    [and]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>;
} | {
    [not]: AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>;
})[]>

An optional parameter to specify a where clause for partial unique indexes (note: ON CONFLICT WHERE not ON CONFLICT DO UPDATE WHERE). Only supported in Postgres >= 9.5 and sqlite >= 9.5

Type declaration

  • [or]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>

Type declaration

  • [and]: AllowArray<AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>>

Type declaration

  • [not]: AllowNotOrAndWithImplicitAndArrayRecursive<Fn | Literal | Where | Json | WhereAttributeHash<unknown>>
creatableFields?: customFields
fields?: sequelizeFunc<undefined> | never[] | sequelizeFunc<never[]>

Fields to insert (defaults to all fields)

hooks?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>

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

ignoreDuplicates?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>

Ignore duplicate values for primary keys?

Default

false
include?: string | ModelType<any, any> | Association<Model<any, any>, Model<any, any>> | IncludeOptions | {
    all: true;
    nested?: true;
} | Includeable[] | sequelizeFunc<undefined> | sequelizeFunc<string> | sequelizeFunc<ModelType<any, any>> | sequelizeFunc<Association<Model<any, any>, Model<any, any>>> | sequelizeFunc<IncludeOptions> | sequelizeFunc<{
    all: true;
    nested?: true;
}> | sequelizeFunc<Includeable[]>

Include options. See find for details

Type declaration

  • all: true
  • Optional nested?: true
individualHooks?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>

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

logging?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true> | ((sql, timing?) => void) | sequelizeFunc<((sql, timing?) => void)>

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

Type declaration

    • (sql, timing?): void
    • Parameters

      • sql: string
      • Optional timing: number

      Returns void

middleware?: expressFunc
path?: string
returning?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true> | never[] | sequelizeFunc<never[]>

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

searchPath?: string | sequelizeFunc<undefined> | sequelizeFunc<string>

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

updateOnDuplicate?: sequelizeFunc<undefined> | never[] | sequelizeFunc<never[]>

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 | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>

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