agrag.graphdb.base.GraphStoreTransaction
Bases: Protocol
The read/write/upsert surface available inside transactional work.
A structural type, not a base class: GraphStore itself satisfies it
(the default run_in_transaction() passes self), and a backend's own
transaction handle, such as Neo4j's, satisfies it without inheriting from
anything here.
Functions:
- execute_read – Run a read inside the surrounding transaction.
- execute_write – Run a write inside the surrounding transaction.
- fulltext_copy_set – Return
SETclauses a backend needs to keep written text searchable. - upsert_nodes – Write or merge nodes inside the surrounding transaction.
- upsert_relations – Write or merge relationships inside the surrounding transaction.
- vector_value – Wrap a Cypher expression that holds an embedding for a property write.
execute_read
execute_read(query:str, parameters:Mapping[str, Any] | None = None) -> list[dict[str, Any]]
Run a read inside the surrounding transaction.
execute_write
execute_write(query:str, parameters:Mapping[str, Any] | None = None) -> list[dict[str, Any]]
Run a write inside the surrounding transaction.
A non-null pending_job_id parameter fences the write by its job,
as GraphStore.execute_write does.
fulltext_copy_set
fulltext_copy_set(alias:str, source:str, properties:Iterable[str]) -> str
Return SET clauses a backend needs to keep written text searchable.
Returns:
str– Clauses to add to the write, or an empty string when the backendstr– searches the stored text directly.
upsert_nodes
upsert_nodes(label:str, nodes:Sequence[NodeRecord], *, batch_size:int = 256, pending_job_id:UUID | None = None, deferred:DeferredWrites | None = None) -> UpsertResult | None
Write or merge nodes inside the surrounding transaction.
pending_job_id tags the rows the call creates. A write that reaches
a row the job did not create is not applied and is added to deferred,
which is required when pending_job_id is set.
Raises:
GraphStoreWriteConflictError–deferredis None and a row is owned by another in-flight job. Neo4j rolls back the callback's writes. FalkorDB retains earlier completed statements.
upsert_relations
upsert_relations(relations:Sequence[RelationRecord], *, batch_size:int = 256, pending_job_id:UUID | None = None, deferred:DeferredWrites | None = None) -> UpsertResult | None
Write or merge relationships inside the surrounding transaction.
pending_job_id tags the rows the call creates. A write that reaches
a row the job did not create is not applied and is added to deferred,
which is required when pending_job_id is set.
Raises:
GraphStoreWriteConflictError–deferredis None and a relationship is owned by another in-flight job. Neo4j rolls back the callback's writes. FalkorDB retains earlier statements.
vector_value
vector_value(expression:str) -> str
Wrap a Cypher expression that holds an embedding for a property write.
Returns:
str– The expression to assign to a vector property. Backends that storestr– a plain float list returnexpressionunchanged.