Interface UpdateOptions<TAttributes>

Options used for Model.update

Type Parameters

  • TAttributes = any

Hierarchy

Properties

benchmark?: boolean

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

fields?: (keyof TAttributes)[]

Fields to update (defaults to all fields)

hooks?: boolean

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

Default

true

individualHooks?: boolean

Run before / after update hooks?. If true, this will execute a SELECT followed by individual UPDATEs. A select is needed, because the row data needs to be passed to the hooks

Default

false

limit?: Nullish<number | Literal>

How many rows to update

Only for mysql and mariadb, Implemented as TOP(n) for MSSQL; for sqlite it is supported only when rowid is present

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

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

paranoid?: boolean

If true, only non-deleted records will be returned. If false, both deleted and non-deleted records will be returned.

Only applies if paranoid is true for the model.

Default

true

returning?: boolean | (keyof TAttributes)[]

Return the affected rows (only for postgres)

Default

false

sideEffects?: boolean

Whether to update the side effects of any virtual setters.

Default

true

silent?: boolean

If true, the updatedAt timestamp will not be updated.

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.

validate?: boolean

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

Default

true

where: WhereOptions<TAttributes>

Options to describe the scope of the search.

Generated using TypeDoc