Getting Started

Tutorial: Building with CleaveDB

Restore (SALVAGE)

Accidental deletions happen. Whether caused by an application bug or an erroneous query, CleaveDB provides the SALVAGE command to restore soft-deleted records directly from the _rubbish bin back into their original buckets.

Restore a document by ID

To restore a specific drained document, specify the bucket and document ID:

CleaveQLExample · Restore a single user
SALVAGE users "jane"

CleaveDB locates Jane's record in _rubbish, validates that no conflicting record with the same ID has been created in the meantime, and restores the document back to active status in the users bucket.

Restoring filtered documents

You can restore batches of soft-deleted documents matching a query condition:

CleaveQLExample · Restore matching records
SALVAGE orders WHERE status = "cancelled"

Every drained order document meeting the filter is restored simultaneously within an atomic transaction.

Reactivating graph relationships

When a document is salvaged, CleaveDB automatically reactivates any dormant graph bonds that were suspended during the DRAIN step. Subsequent graph traversal queries (FIND, FOLLOW, and TRACE) can once again traverse through the restored node.