Skip to content

feat: add batchFind* methods to edge collections for store.batch()#52

Merged
pdlug merged 1 commit into
mainfrom
feat/edge-collections-batchable-query
Mar 26, 2026
Merged

feat: add batchFind* methods to edge collections for store.batch()#52
pdlug merged 1 commit into
mainfrom
feat/edge-collections-batchable-query

Conversation

@pdlug
Copy link
Copy Markdown
Contributor

@pdlug pdlug commented Mar 26, 2026

  • Add batchFindFrom, batchFindTo, and batchFindByEndpoints to edge collections, returning BatchableQuery for use with store.batch()
  • Add compile-time type assertions (source-level @ts-expect-error + tsd declaration tests) verifying endpoint constraints and return types
  • Update docs: schemas-stores, queries/execute, performance/overview

Motivation

Edge collection lookups (findFrom, findTo, findByEndpoints) execute immediately and can't participate in store.batch(). This forces users to rewrite simple edge lookups as verbose fluent traverse queries to batch them. The new batchFind* variants close this gap.

const [skills, employer] = await store.batch(
  store.edges.hasSkill.batchFindFrom(alice),
  store.edges.worksAt.batchFindFrom(alice),
);

Closes #51

Edge collection lookups (findFrom, findTo, findByEndpoints) execute
immediately and cannot participate in store.batch(). Add deferred
variants — batchFindFrom, batchFindTo, batchFindByEndpoints — that
return BatchableQuery for single-connection batched execution.
@pdlug pdlug force-pushed the feat/edge-collections-batchable-query branch from 466dd46 to 14f61ff Compare March 26, 2026 18:23
@pdlug pdlug merged commit 1e3da4a into main Mar 26, 2026
10 checks passed
@pdlug pdlug deleted the feat/edge-collections-batchable-query branch March 26, 2026 18:26
@github-actions github-actions Bot mentioned this pull request Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edge collections should expose BatchableQuery for use with store.batch()

1 participant