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

TaskCommandBenefit
Renaming or restructuring fieldsMIGRATE bucket FROM {...} TO {...}Instant bulk transformation with zero downtime
Purging dangling graph edgesHEAL BONDSRestores graph integrity without manual audits
Discovering implicit relationshipsSUGGEST BONDSSurfaces foreign keys and AI semantic links

Explore the Schema Topics

Dive into the hands-on tutorials below: