Version Packages#266
Open
github-actions[bot] wants to merge 1 commit into
Open
Conversation
10f93fb to
e46c1ba
Compare
e46c1ba to
71488d3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.37.0
Minor Changes
#269
92479d4Thanks @pdlug! - Vector storage now rides the #135 durable-contribution machinery, so theruntime never issues DDL on the embedding hot path.
Previously every vector op (
upsertEmbedding/deleteEmbedding/vectorSearch/createVectorIndex) lazily ranCREATE TABLE IF NOT EXISTSfor its per-
(kind, field)table on whatever connection it executed on. On aleast-privilege Postgres role (USAGE on
public, full DML, but noCREATE)this failed with
permission denied for schema public(SQLSTATE 42501) — evenwhen the table already existed, because Postgres runs the schema aclcheck before
the
IF NOT EXISTSshort-circuit. The fulltext path already avoided this viadurable markers; vectors now do too.
What changed:
createStoreWithSchemaprovisions every embedding(kind, field)table + a durable contribution marker, enumerated from thegraph.
evolve()provisions any embedding fields it introduces. A slotalready provisioned at a different shape (the declared dimension changed)
is warned about and left untouched — boot stays reachable so
store.reembedVectorField()can recreate it; until then, writes to thatfield fail with a
staleStoreNotInitializedErrorthat points atreembedVectorField.upsertEmbedding(single and batch) anddeleteEmbeddingassert the durable marker with a cached, signature-checkedSELECT and run DML — never DDL.
createVerifiedStoreverifies vector markersat attach, alongside fulltext.
store.search.vector,store.search.hybrid, and query-builder.similarTo()predicates compile toSQL against the per-field table directly (searches may override the metric at
query time, so their slot legitimately differs from the provisioned shape);
against an un-provisioned database they surface the engine's missing-relation
error, which
createVerifiedStorecatches at attach.reembedVectorFieldre-stamps the marker after recreating storage at a newdimension; vector-field reclaim (
materializeRemovals) clears the marker whenit drops a table.
Breaking: vector ops now require a prior privileged
createStoreWithSchema(exactly as fulltext already does). A plain
createStore+ embedding write withno provisioning step throws
StoreNotInitializedErrorinstead of lazilycreating the table.
Migration: after upgrading, run
createStoreWithSchema(graph, adminBackend)once under the schema-owner role. It creates the per-field vector tables +
markers; least-privilege runtimes then assert markers (SELECT) and run vector
DML with zero DDL — no
GRANT CREATErequired.Consumers that boot manually (raw DDL + the sync
createStoreattach +backend.ensureRuntimeContributions) provision vectors the same way: the newresolveGraphVectorSlots(graph)export enumerates every embedding(kind, field)slot, andbackend.ensureVectorSlotContribution(slot)materializes each — the exact step
createStoreWithSchemaperforms. Batchcounterparts (
backend.ensureVectorSlotContributions(slots)/backend.assertVectorSlotsInitialized(slots)) resolve every slot's markerswith one graph-scoped query — what boot and verified attach use, and the
right choice for many embedding fields over a remote connection.
#273
42f6941Thanks @pdlug! - AddtrustedImportGraphandtrustedImportGraphStreamfor atomic initial loadsinto a fresh, dedicated database. The distinct trusted surface bypasses schema,
reference, cardinality, and conflict validation; uses prepared SQLite writes or
PostgreSQL
UNNESTingestion; defers rebuildable secondary indexes; refreshesplanner statistics; and rolls the complete stream back on any failure.
The first version rejects non-empty TypeGraph data tables, recorded history,
revision tracking, uniqueness constraints, searchable fields, vector fields,
and backends without the required native transactional path.
Patch Changes
#265
35ab2a0Thanks @pdlug! - Docs: scope thecoalesceUnchangedUpsertsbenefit correctly. Coalescingeliminates re-delivery churn (an already-applied change delivered again,
value-identical to the live row). It does not make a full replay-from-zero
free when the stream supersedes values in place: re-applying an older value
over the live row is a genuine change, and restoring the current value
afterwards is another, so such a replay still writes — and leaves a spurious
back-and-forth band in the live store's recorded history. Churn-free rebuilds
replay into a fresh store instead. Clarified in the option's TSDoc and in the
"Materializing external event logs" guide; no behavior change.
#274
2a889aaThanks @pdlug! - Replace path-enumerating recursive CTEs inreachable,neighbors,shortestPath, andcanReachwith set-based breadth-first search.Transactional SQLite and PostgreSQL backends now execute graph iterations
against a connection-local temporary working table, de-duplicated by node kind
and ID on every round. Non-transactional backends retain parity through a
bind-limit-aware inline frontier. Traversals run in one snapshot where the
backend supports transactions, preserve temporal filtering, and clean up
temporary state on success or failure.