space
delete
Delete a product space from a branch.
strata space deletedb.spaces.delete(name: 'str', *, force: 'bool' = False) -> 'Any'wire space_delete
Drops the product space from the branch catalog. The `default` space refuses deletion with `invalid_argument.engine.space_delete_default`. A space that still contains visible data refuses deletion with `failed_precondition.engine.space_not_empty` unless `force: true` is set, which tombstones the visible rows first and reports the count. Deleting a space that does not exist succeeds with `deleted: false`.
A space of any size deletes. One whose rows fit a single commit goes in that commit; a larger one is unregistered by its first commit - gone from `space list` and `space exists`, and a write of the name finishes the sweep and lands in a fresh, empty space rather than the one being deleted - and its rows are then swept in commits the storage budget admits, the catalog row last. A deletion interrupted mid-sweep is finished by the next `space delete` or `space create` of the name, or by the first write that would register it; the interrupted delete never leaves a half-registered space. Reads pinned before the deletion still see the space as it was.
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 space delete --helphelp(db.spaces.delete)
Example
Delete a product space.
strata space create tempcreated space tempstrata space delete tempdeleted space temp (0 rows)strata space exists tempfalse
_ = db.spaces.create("temp")_ = db.spaces.delete("temp")db.spaces.exists("temp")
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| space | string | yes | Product space name. |
| branch | string or null | no | Target branch. Defaults to the executor handle branch. |
| force | boolean | no | Delete visible data in the space before dropping the catalog entry. |
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.product_space_reserved | never | not_started |
| invalid_argument.engine.space_delete_default | never | not_started |
| failed_precondition.engine.space_not_empty | never | not_started |