neuxdb 0.1.0

A super simple, embedded, encrypted database like SQLite, using pipe-separated files and age encryption.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::error::{NeuxDbError, Result};
pub fn run_script(path: &str, callback: impl Fn(&str) -> Result<()>) -> Result<()> {
    let file = std::fs::File::open(path)?;
    use std::io::{BufRead, BufReader};
    let reader = BufReader::new(file);
    for (line_no, line_result) in reader.lines().enumerate() {
        let line = line_result?;
        let line = line.trim();
        if line.is_empty() || line.starts_with('#') {
            continue;
        }
        callback(line).map_err(|e| NeuxDbError::Parse(format!("Line {}: {}", line_no + 1, e)))?;
    }
    Ok(())
}