Options
All
  • Public
  • Public/Protected
  • All
Menu

Options used for Model.destroy

Hierarchy

Index

Properties

Optional benchmark

benchmark: boolean

Print query execution time in milliseconds when logging SQL.

Optional cascade

cascade: boolean

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.

Defaults to false;

Optional force

force: boolean

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

Optional hooks

hooks: boolean

Run before / after bulk destroy hooks?

Optional individualHooks

individualHooks: boolean

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

Optional limit

limit: number

How many rows to delete

Optional logging

logging: boolean | Function

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

Optional searchPath

searchPath: string

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

Optional transaction

transaction: Transaction

Transaction to run query under

Optional truncate

truncate: boolean

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

Optional where

Filter the destroy

Generated using TypeDoc