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/SchemaFromSource.md
SchemaFromSource
ts
type SchemaFromSource<T> = Prettify<{ [K in keyof T]: T[K] extends CollectionImpl<any, any, any, any, any> ? InferCollectionType<T[K]> : T[K] extends CollectionOptionsIdentity<any, any, any, any, any> ? InferCollectionType<T[K]> : T[K] extends QueryBuilder<infer TContext> ? GetRawResult<TContext> : never }>;Defined in: packages/db/src/query/builder/types.ts:131
SchemaFromSource - Converts a Source definition into a ContextSchema
This transforms the input to from() into the schema format used throughout the query builder. For each alias in the source:
- Collections → their inferred TypeScript type
- Subqueries → their result type (what they would return if executed)
The Prettify wrapper ensures clean type display in IDEs.
Type Parameters#
T#
T extends Source