🌿 Branches & Namespaces
Schema branches for "what-if" analysis; namespace handles for the search-developer shape.
Schema branches (copy-on-write forks)
client.create_schema_branch("hypothesis-bribery", from_branch="main")
# {"created": True, "branch": "hypothesis-bribery", "source": "main"}
<Note title="Relata DB 3.0">Parts of this page still describe the 2.x line, which is kept in the [2.5.8 documentation snapshot](/docs/2.5.8). In 3.0 HTTP routes are under `/v1/`, the compatibility protocol doors (Postgres, Mongo, Redis, Neo4j, ClickHouse, S3, Flight, SPARQL) are retired, and clustering and multi-tenancy are Enterprise. See [What is new in 3.0](/docs/whats-new-in-3) and [HTTP route restructure](/docs/reference/v1-routes).</Note>
# Ingest alternative theories into the branch, run queries, compare.
# Then either merge or delete:
client.delete_schema_branch("hypothesis-bribery")
# {"deleted": True}Namespace handle — schemaless write + typed search
docs = client.namespace("CaseDoc")
# Schemaless upsert (POST /ingest/auto — auto-creates the type if absent).
docs.write([
{"id": "memo1", "title": "Bribery hypothesis",
"body": "Pacific Trust may be a kickback conduit.", "status": "draft"},
], schema={"title": "text", "body": "text"})
# Typed ranked search — text compiles to BM25; filters narrow server-side.
res = docs.query(
text="bribery kickback",
match_column="title",
filters=[{"field": "status", "op": "eq", "value": "draft"}],
limit=5,
)
for row in res:
print(row["title"])
docs.get("memo1") # point lookup
docs.delete_all() # governed bi-temporal tombstone every row
docs.branch_from("CaseDoc") # T10 copy-on-write namespace branchOne client, one connection pool, reused across every namespace. Governance (auth, tenant, purpose) travels in the substrate.
Next: System Ops — the SSE observe stream and webhooks.