MCPcopy Create free account
hub / github.com/TanStack/db / computeRoutingKey

Function computeRoutingKey

packages/db/src/query/live/collection-config-builder.ts:1799–1805  ·  view source on GitHub ↗

* Computes a composite routing key from correlation key and parent context. * When parentContext is null (no parent filters), returns the raw correlationKey * for zero behavioral change on existing queries.

(
  correlationKey: unknown,
  parentContext: Record<string, any> | null,
)

Source from the content-addressed store, hash-verified

1797 * for zero behavioral change on existing queries.
1798 */
1799function computeRoutingKey(
1800 correlationKey: unknown,
1801 parentContext: Record<string, any> | null,
1802): unknown {
1803 if (parentContext == null) return correlationKey
1804 return JSON.stringify([correlationKey, parentContext])
1805}
1806
1807/**
1808 * Creates a child Collection entry for includes subqueries.

Callers 4

setupIncludesOutputMethod · 0.85
setupNestedPipelinesFunction · 0.85
updateRoutingIndexFunction · 0.85
flushIncludesStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected