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

Method _createRefForSource

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

* Creates a CollectionRef or QueryRef from a source object * @param source - An object with a single key-value pair * @param context - Context string for error messages (e.g., "from clause", "join clause") * @returns A tuple of [alias, ref] where alias is the source key and ref is the creat

(
    source: TSource,
    context: SourceClauseContext,
  )

Source from the content-addressed store, hash-verified

89 * @returns A tuple of [alias, ref] where alias is the source key and ref is the created reference
90 */
91 private _createRefForSource<TSource extends Source>(
92 source: TSource,
93 context: SourceClauseContext,
94 ): [string, CollectionRef | QueryRef] {
95 const refs = this._createRefsForSource(source, context)
96 if (refs.length !== 1) {
97 throw new OnlyOneSourceAllowedError(context)
98 }
99 return refs[0]!
100 }
101
102 private _createRefsForSource<TSource extends Source>(
103 source: TSource,

Callers 2

fromMethod · 0.95
joinMethod · 0.95

Calls 1

_createRefsForSourceMethod · 0.95

Tested by

no test coverage detected