QueryRepository
Defined in: packages/core/persistence/query-repository.abstract.ts:73
Base class for read-side (query) repositories.
Resolves a query via the abstract find method and receives an
ICache instance. Subclasses annotate find() with the @FromCache decorator
to serve cached results, bypass cache, or rehydrate snapshots into domain entities.
Examples
Section titled “Examples”Creating a query repository with the FromCache decorator
Declaring rehydration once for the whole repository
A method that declares hydrateFn (including null) or serializeFn
uses its own value instead of the repository default.
Type Parameters
Section titled “Type Parameters”TQuery
Section titled “TQuery”TQuery = IQueryOptions
The query/options type accepted by find.
TResult
Section titled “TResult”TResult = unknown
The result type returned by find.
Implements
Section titled “Implements”IQueryRepository<TQuery,TResult>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new QueryRepository<
TQuery,TResult>(cache,hydration?):QueryRepository<TQuery,TResult>
Defined in: packages/core/persistence/query-repository.abstract.ts:76
Parameters
Section titled “Parameters”ICache<unknown>
hydration?
Section titled “hydration?”QueryRepositoryHydration<TResult>
Returns
Section titled “Returns”QueryRepository<TQuery, TResult>
Properties
Section titled “Properties”
protectedreadonlycache:ICache<unknown>
Defined in: packages/core/persistence/query-repository.abstract.ts:77
hydration?
Section titled “hydration?”
protectedreadonlyoptionalhydration?:QueryRepositoryHydration<TResult>
Defined in: packages/core/persistence/query-repository.abstract.ts:78
Methods
Section titled “Methods”find()
Section titled “find()”
abstractfind(query):Promise<TResult>
Defined in: packages/core/persistence/query-repository.abstract.ts:81
Resolves one application query.
Parameters
Section titled “Parameters”TQuery
Returns
Section titled “Returns”Promise<TResult>