cynos-storage
Storage layer for Cynos in-memory database.
Overview
This crate provides the storage layer including:
RowStore: Row storage with index maintenanceTableCache: Multi-table cache managementJournal: Change tracking for transactionsTransaction: Transaction management with rollback supportConstraintChecker: Constraint validationLockManager: Concurrent access control
Features
#![no_std]compatible- ACID transaction support
- Automatic index maintenance
- Constraint enforcement (primary key, unique, foreign key)
- Optional hash-based storage via
hash-storefeature
Usage
use ;
use TableBuilder;
use ;
// Create a cache and table
let mut cache = new;
let schema = new
.unwrap
.add_column
.unwrap
.add_column
.unwrap
.add_primary_key
.unwrap
.build
.unwrap;
cache.create_table.unwrap;
// Use a transaction
let mut tx = begin;
let row = new;
tx.insert.unwrap;
tx.commit.unwrap;
assert_eq!;
Transaction Support
begin(): Start a new transactioninsert(),update(),delete(): DML operationscommit(): Commit changesrollback(): Rollback changes
License
Apache-2.0