Skip to content

Version Packages - #685

Merged
pdlug merged 2 commits into
mainfrom
changeset-release/main
Sep 11, 2026
Merged

Version Packages#685
pdlug merged 2 commits into
mainfrom
changeset-release/main

Conversation

@github-actions

@github-actions github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@nicia-ai/typegraph@0.58.0

Highlights

TypeGraph 0.58 reduces database round trips in graph read paths. store.bulkFindEdgesTo and its pinned-view counterpart resolve inbound edges for a set of targets across node and edge kinds, mirroring bulkFindEdgesFrom. Callers can replace per-target lookups with a set-oriented read while retaining input order, repeated and empty target buckets, temporal visibility, and per-input limits. For a single edge kind, the existing edges.Kind.bulkFindTo remains available.

Whole-node and whole-edge selections now choose a full-row fetch before executing SQL, including nested and spread selections detected during planning. Previously, a fresh query instance could issue a projected query, discover that the selector needed the complete entity, and fetch again. These selections now avoid that extra statement without requiring applications to retain query instances between requests. Selectors whose field needs depend on row values keep the existing fallback.

executeChecked(expectedSchemaVersion) combines a relational read with an active schema-version check in one statement snapshot. It offers an explicit alternative to probing the committed version before fetching data: a mismatch raises SchemaChangedError before the selector runs, even when the query returns no rows. Applications can then reload the schema and rebuild the query before retrying. The check covers that statement; it does not pin later reads in the request or replace write fences.

Upgrade notes

  • Update hand-built Store mocks and wrappers exposing the full store surface with bulkFindEdgesTo; query wrappers exposing the full executable-query surface must also forward executeChecked. Library-created stores, pinned views, and queries provide the new methods automatically.
  • When adopting executeChecked, catch SchemaChangedError, reload the reconciled schema, and rebuild the query before retrying. Start a new transaction if the old transaction holds a repeatable-read snapshot. An expected version of undefined means no active schema and is distinct from version zero.
  • Use checked reads for relational queries with ordinary bound values. They fetch full rows and support traversals, ordering, offsets, and limits; recursive and relevance-ranked queries require a separate schema probe. Replace named param() references with bound values before building a checked query.
  • Custom backends adopting checked reads must supply tableNames.schemaVersions, naming a relation with graph_id, version, and is_active columns whose active row agrees with getActiveSchema. A missing binding raises ConfigurationError before SQL execution. Bundled SQLite and PostgreSQL backends supply it automatically; this release requires no database migration.

Minor Changes

  • #683 ce35043 Thanks @pdlug! - Add store.bulkFindEdgesTo and its pinned-view counterpart for set-oriented inbound reads across edge kinds. Detect whole-node and whole-edge selections before issuing a projected query, avoiding a redundant fetch for fresh query instances. Add executeChecked(expectedSchemaVersion) for a relational read and committed-schema check in one statement, with SchemaChangedError on mismatch, including empty results.

@pdlug
pdlug merged commit e2cf9f2 into main Sep 11, 2026
14 checks passed
@pdlug
pdlug deleted the changeset-release/main branch September 11, 2026 21:58
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.

1 participant