graph
delete
Delete a graph and its visible data.
strata graph deletedb.graphs.delete(name: 'str') -> 'Any'wire graph_delete
Deletes a named graph and every visible node, edge, binding, and ontology row it owns. Deleting a graph that does not exist is not an error: the acknowledgement reports `deleted: false` with a `not_found` effect. Earlier states remain readable through time travel on other commands.
A graph too large for one commit is deleted in several: it disappears at the first - every read and write of it refuses `not_found.engine.graph` from then on - its rows are swept in later commits, and the acknowledged commit is the last, with row counts that cover the whole deletion. If the sweep is interrupted, the next `graph delete` (or `graph create` of the same name) finishes it before doing anything else, so no row of the old graph ever surfaces under the new one.
Successful mutations return an acknowledgement of the outcome: for a state-changing write, the affected target with the mutation effect and commit facts; for mutations that produce a domain result (such as a branch or a promotion outcome), that result object.
To see the complete help for this command, run:
strata graph delete --helphelp(db.graphs.delete)
Example
Delete a graph.
strata graph create tempcreated graph tempstrata graph delete tempdeleted graph tempstrata graph list(empty)
_ = db.graphs.create("temp")_ = db.graphs.delete("temp")db.graphs.list()
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| graph | string | yes | Graph name. |
| branch | string or null | no | Target branch. Defaults to the executor handle branch. |
| force | boolean | no | Delete the graph's nodes and edges before dropping it. A populated graph is refused without this. |
| space | string or null | no | Target product space. Defaults to `"default"`. |
Returns
MutationAck
- dataobject
- typestring
Errors
Recover by code. Retry policy and commit outcome come from the shipped error registry.
| Code | Retry | Commit outcome |
|---|---|---|
| failed_precondition.engine.runtime_closed | never | not_started |
| not_found.engine.branch | never | not_applicable |
| invalid_argument.engine.product_space | never | not_started |
| invalid_argument.engine.graph_name | never | not_started |
| not_found.engine.graph | never | not_applicable |
| failed_precondition.engine.graph_not_empty | never | not_started |