dactyl-db 0.1.4

Governed datastore boundary for Decapod. Routes queries to SQLite or Neon adapters behind a single read/write facade.
Documentation
//! Tiny runnable example referenced from README.
//!
//! Run with:
//!
//! ```text
//! cargo run --features sqlite --example readme_example
//! ```
//!
//! Boots dactyl against `.decapod/data/todos.db` (auto-derived from the
//! `from todos` clause in the query) and prints the rows.

use dactyl_db::Row;

fn main() -> Result<(), dactyl_db::DactylError> {
    for row in dactyl_db::read("select id, title, status from todos", true)?.iter() {
        print_row(row);
    }
    Ok(())
}

fn print_row(r: &Row) {
    for (c, v) in r.columns.iter().zip(r.values.iter()) {
        println!("{c} = {v}");
    }
    println!("---");
}