MCPcopy Index your code
hub / github.com/TanStack/db / from

Method from

packages/db/src/query/builder/index.ts:175–184  ·  view source on GitHub ↗

* Specify the source table or subquery for the query * * @param source - An object with a single key-value pair where the key is the table alias and the value is a Collection or subquery * @returns A QueryBuilder with the specified source * * @example * ```ts * // Query from a c

(
    source: SingleSource<TSource>,
  )

Source from the content-addressed store, hash-verified

173 * ```
174 */
175 from<TSource extends Source>(
176 source: SingleSource<TSource>,
177 ): QueryBuilder<ContextFromSource<TSource>> {
178 const [, from] = this._createRefForSource(source, `from clause`)
179
180 return new BaseQueryBuilder({
181 ...this.query,
182 from,
183 }) as any
184 }
185
186 /**
187 * Union multiple independent source streams in one query.

Callers 15

syncDataFromCollectionFunction · 0.80
assertAllItemsMatchFunction · 0.80
getLoadedIdsFunction · 0.80
createMutationsTestSuiteFunction · 0.80
createJoinsTestSuiteFunction · 0.80
createCollationTestSuiteFunction · 0.80

Calls 1

_createRefForSourceMethod · 0.95

Tested by 15

createRecordingAdapterFunction · 0.64
keysMethod · 0.64
createMockCollectionFunction · 0.64
triggerAllTimeoutsFunction · 0.64
getStateEntriesFunction · 0.64
createBasicTestsFunction · 0.64
testJoinTypeFunction · 0.64
createJoinTestsFunction · 0.64
createSubqueryTestsFunction · 0.64