Skip to content

FirstQueryBehaviour

FirstQueryBehaviour<TResult, TFallback> = { behaviour: "error"; } | { behaviour: "undefined"; } | { behaviour: "fallback"; fallback: () => TResult | TFallback; }

Defined in: packages/@livestore/common/dist/schema/state/sqlite/query-builder/api.d.ts:156

TResult

TFallback

{ behaviour: "error"; }

behaviour: "error"

Will error if no matching row was found

{ behaviour: "undefined"; }

behaviour: "undefined"

Will return undefined if no matching row was found

{ behaviour: "fallback"; fallback: () => TResult | TFallback; }

behaviour: "fallback"

Will return a fallback value if no matching row was found

fallback: () => TResult | TFallback

TResult | TFallback