interface deleteOptions {
    benchmark?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    byField?: string;
    cascade?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    force?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    hooks?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    individualHooks?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    limit?: number | sequelizeFunc<undefined> | sequelizeFunc<number>;
    logging?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true> | ((sql, timing?) => void) | sequelizeFunc<((sql, timing?) => void)>;
    middleware?: expressFunc;
    restartIdentity?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
    truncate?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>;
}

Hierarchy (view full)

  • operationFieldCore
  • expressCrudProps<Omit<DestroyOptions<unknown>, "where" | "transaction">>
    • deleteOptions

Properties

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

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

byField?: string
cascade?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>

Only used in conjuction with TRUNCATE. Truncates all tables that have foreign-key references to the named table, or to any tables added to the group due to CASCADE.

Default

false;
force?: boolean | sequelizeFunc<undefined> | sequelizeFunc<false> | sequelizeFunc<true>

Delete instead of setting deletedAt to current timestamp (only applicable if paranoid is enabled)

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

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

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

If set to true, destroy will SELECT all records matching the where parameter and will execute before / after destroy hooks on each row

limit?: number | sequelizeFunc<undefined> | sequelizeFunc<number>

How many rows to delete

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

Only used in conjunction with truncate. Automatically restart sequences owned by columns of the truncated table

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

If set to true, dialects that support it will use TRUNCATE instead of DELETE FROM. If a table is truncated the where and limit options are ignored