Expand description
In-place mutation primitives for DELETE / DETACH DELETE (#740).
Unlike GraphWriter, which buffers and appends,
these functions rewrite committed Parquet files: they read the current
on-disk rows, drop the targeted ones (by node_uuid / edge_uuid), and
write the survivors back. They operate directly on a project directory and
take effect immediately — there is no buffering.
Each file is read, filtered against a keep-mask, and its replacement staged
into a RewriteBatch; a delete’s rewrites then commit all-or-nothing
(#790), with topology/nodes.parquet renamed last so even a (rare)
rename-phase failure leaves at worst orphaned-but-unreferenced rows, never
a deleted node with surviving edges. A failure while building any
replacement file leaves the prior state fully intact. Files not touched by
a given delete are never opened.
Functions§
- delete_
edges - Delete the given edges by
edge_uuid, rewriting everytopology/edges/*.parquetfile and dropping the same edges’ rows from anyedge_properties/*.parquet. - delete_
nodes - Delete the given nodes by
node_uuid, rewritingtopology/nodes.parquetand dropping the same nodes’ rows from everyproperties/*.parquetfile. - delete_
nodes_ and_ edges - Delete nodes and edges as one all-or-nothing statement (#790): stages
every rewrite — edge files, edge properties, node properties, and
topology/nodes.parquetstrictly last — then commits once. A failure while building any replacement file leaves the prior on-disk state fully intact; a (rare) rename-phase failure is bounded by the ordering to consistent states — at worst orphaned-but-unreferenced rows, never a deleted node with surviving edges. - incident_
edge_ uuids - Return the
edge_uuids of every edge incident to any ofnode_uuids(assrcordst), across all edge files. - stage_
add_ node_ labels - Stage label additions for persisted nodes into the statement rewrite batch.
Existing labels and the immutable primary
type_idare preserved. - stage_
delete_ edges - Stage the deletion of the given edges into
staged: everytopology/edges/*.parquet, then anyedge_properties/*.parquet. Returns the edge rows that will be removed. - stage_
delete_ nodes - Stage the deletion of the given nodes into
staged: everyproperties/*.parquetfirst, thentopology/nodes.parquetlast — the authoritative existence record commits only after everything that refers to those nodes (#790). Returns the node rows that will be removed. - stage_
mutate_ node_ labels - Stage label additions and removals for persisted nodes in one topology
rewrite. The scalar primary
type_idremains unchanged as a routing key;type_idsis the authoritative label-membership set.