monochromium 0.2.0

A fast, local-first CLI note-taking app for developers
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::database::read_rows;

pub async fn export(conn: libsql::Connection) -> Result<Vec<String>, Box<dyn std::error::Error>> {
    let rows = read_rows(conn, -1, None).await?;

    let mut output: Vec<String> = Vec::new();

    for note in rows {
        let push = format!(
            "{} \u{2022} ID: {} \u{2022} {}\n {}",
            note.title, note.id, note.date, note.content
        );
        output.push(push);
    }

    Ok(output)
}