Skip to main content
zerotal

Documentation


Documentation / zerotal / orm / NPlusOneError

Class: NPlusOneError

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

Thrown (in throw mode) or logged (in warn mode) when one normalised query shape runs more times than the configured threshold within a single request — the signature of an N+1 access pattern. Carries the offending fingerprint and its count; error code E_N_PLUS_ONE.

Extends

Constructors

Constructor

new NPlusOneError(fingerprint, count): NPlusOneError

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

Parameters

fingerprint

string

count

number

Returns

NPlusOneError

Overrides

ZerotalError.constructor

Properties

code

readonly code: string

Defined in: packages/core/src/errors/ZerotalError.ts:18

Inherited from

ZerotalError.code


status

readonly status: number = 500

Defined in: packages/core/src/errors/ZerotalError.ts:19

Inherited from

ZerotalError.status


context?

readonly optional context?: Record<string, unknown>

Defined in: packages/core/src/errors/ZerotalError.ts:20

Inherited from

ZerotalError.context


fingerprint

readonly fingerprint: string

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


count

readonly count: number

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