Skip to main content
zerotal

Documentation


Documentation / @zerotal/orm / index / allowNPlusOne

Function: allowNPlusOne()

allowNPlusOne(pattern, options?, ctx?): void

Defined in: packages/orm/src/db/NPlusOneDetector.ts:105

Suppress N+1 warnings for queries involving pattern (matched as a case-insensitive substring of the SQL shape).

Parameters

pattern

string

A table name or any substring of the SQL fingerprint.

options?

{ once: true } — suppress only for the current request.

once?

boolean

ctx?

object | null

Returns

void

Example

DB.allowNPlusOne('activity_logs');              // permanent
DB.allowNPlusOne('taggings', { once: true });   // this request only