| Crates.io | sqlite_pages |
| lib.rs | sqlite_pages |
| version | 0.3.1 |
| created_at | 2025-11-29 02:18:26.898625+00 |
| updated_at | 2026-01-01 23:22:00.980011+00 |
| description | Page-level SQLite database access using sqlite_dbpage virtual table |
| homepage | |
| repository | https://github.com/halzy/sqlite_pages |
| max_upload_size | |
| id | 1956281 |
| size | 127,953 |
Page-level SQLite database access using the sqlite_dbpage virtual table.
This library provides direct access to SQLite's raw database pages via the SQLITE_DBPAGE virtual table. This virtual table exposes the underlying database file at the page level, allowing reads and writes of raw binary page content through SQLite's pager layer.
This is not for normal database operations - use standard SQLite queries for reading and writing data.
Add the following to your .cargo/config.toml:
[env]
LIBSQLITE3_FLAGS = "-DSQLITE_ENABLE_DBPAGE_VTAB"
Without this flag, operations will fail with "no such table: sqlite_dbpage".
use sqlite_pages::SqliteIo;
let db = SqliteIo::new("database.db")?;
// Iterate over all pages
db.page_map(.., |page_num, data| {
println!("Page {}: {} bytes", page_num, data.len());
})?;
use sqlite_pages::{SqliteIo, TransactionType};
let db = SqliteIo::new("target.db")?;
let mut tx = db.transaction(TransactionType::Immediate)?;
for (page_num, data) in pages {
tx.set_page_data(page_num, &data)?;
}
tx.commit()?;
use sqlite_pages::{AsyncSqliteIo, TransactionType};
let db = AsyncSqliteIo::new("target.db").await?;
let tx = db.transaction(TransactionType::Immediate).await?;
tx.set_page_data(1, &page_data).await?;
tx.commit().await?;
Deferred: No lock acquired until first read/write operationImmediate: Write lock acquired immediately (recommended for writes)Exclusive: Exclusive lock acquired immediatelyLicensed under either of Apache License, Version 2.0 or MIT license at your option.