interface createOptions {
    benchmark?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    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[]>;
    isNewRecord?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    logging?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true> | ((sql, timing?) => void) | sequelizeFunc<((sql, timing?) => void)>;
    middleware?: expressFunc;
    raw?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    returning?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true> | never[] | sequelizeFunc<never[]>;
    silent?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    validate?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
}

Hierarchy (view full)

  • operationFieldCore
  • expressCrudProps<Omit<CreateOptions<unknown>, "transaction">>
    • createOptions

Properties

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

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

creatableFields?: customFields
fields?: sequelizeFunc<undefined> | never[] | sequelizeFunc<never[]>

If set, only columns matching those in fields will be saved

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>

dialect specific ON CONFLICT DO NOTHING / INSERT IGNORE

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[]>

An array of include options. A single option is also supported - Used to build prefetched/included model instances. See set

TODO: See set

Type declaration

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

Is this record new

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
raw?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>

If set to true, values will ignore field and virtual setters.

returning?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true> | never[] | sequelizeFunc<never[]>

Return the affected rows (only for postgres)

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

If true, the updatedAt timestamp will not be updated.

Default

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

If false, validations won't be run.

Default

true