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
use crate::database::read_single_row;

pub async fn view(
    conn: libsql::Connection,
    node_id: u32,
    _no_format: bool,
) -> Result<String, Box<dyn std::error::Error>> {
    let note = read_single_row(conn, node_id).await?;

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

    Ok(output)
}