Getting Started
Tutorial: Building with CleaveDB
Schema Migration — Overview
In evolving production applications, data models inevitably change. Traditional databases force teams to run disruptive migration scripts with table locks or write complex application-level translation layers. CleaveDB solves this with declarative, zero-downtime schema operations built directly into CleaveQL.
The Schema Evolution Toolkit
1. MIGRATE (Reshape)
Declaratively transform documents across an entire bucket using pattern matching and capture variables ($1, $2).
2. HEAL (Repair)
Clean up ghost bonds, remove orphaned references after bulk deletes, and rebuild secondary search indexes.
3. SUGGEST BONDS
Intelligently inspect document attributes and semantic vector embeddings to propose missing graph relationships.
When to Use Each Feature
| Task | Command | Benefit |
|---|---|---|
| Renaming or restructuring fields | MIGRATE bucket FROM {...} TO {...} | Instant bulk transformation with zero downtime |
| Purging dangling graph edges | HEAL BONDS | Restores graph integrity without manual audits |
| Discovering implicit relationships | SUGGEST BONDS | Surfaces foreign keys and AI semantic links |
Explore the Schema Topics
Dive into the hands-on tutorials below:
- MIGRATE — reshape documents: rename fields, duplicate attributes, and upgrade document schemas with pattern matching.
- HEAL — repair integrity: prune orphaned edges, fix ghost pointers, and rebuild indexes.
- SUGGEST BONDS: discover unlinked graph relationships using foreign key heuristics and vector similarity.
