Skip to main content

Module database

Module database 

Source
Expand description

RedDB Database Engine

The main entry point for the RedDB storage engine. Integrates all components:

  • Pager for page I/O
  • WAL for durability
  • Transactions for ACID properties
  • Checkpointing for WAL management
  • B-tree for indexing

§Usage

use reddb::storage::engine::Database;

// Open or create a database
let db = Database::open("mydata.rdb")?;

// Begin a transaction
let tx = db.begin()?;

// Perform operations
tx.put(b"key", b"value")?;

// Commit
tx.commit()?;

// Close (or let it drop)
db.close()?;

§File Layout

mydata.rdb     - Main database file (pages)
mydata.rdb-wal - Write-ahead log

§References

  • Turso core/database.rs - Database lifecycle
  • SQLite architecture documentation

Structs§

Database
RedDB Database Engine
DatabaseConfig
Database configuration

Enums§

DatabaseError
Database error types