DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/type-aliases/WithResult.md
WithResult
ts
type WithResult<TContext, TResult> = Prettify<Omit<TContext, "result" | "hasResult"> & Pick<TContext, "baseSchema" | "schema" | "fromSourceName"> & object>;Defined in: packages/db/src/query/builder/types.ts:1359
WithResult - Updates a context with a new result type after select()
This utility type is used internally when the select() method is called to update the context with the projected result type. It preserves all other context properties while replacing the result field.
Usage: When select() is called, the query builder uses this type to create a new context where result contains the shape of the selected fields.
The double Prettify ensures both the overall context and the nested result type display cleanly in IDEs.
Type Parameters#
TContext#
TContext extends Context
TResult#
TResult