Skip to main content

lora_io/
lib.rs

1//! Row-level data I/O codecs for LoraDB.
2//!
3//! `lora-io` is the row-level counterpart to `lora-snapshot`. Snapshots
4//! ship the entire graph as a binary blob; `lora-io` ships **rows**
5//! as JSONL, JSON, or CSV. Encoders consume native
6//! [`lora_executor::Row`] values and stream them to any
7//! [`std::io::Write`]; decoders parse incoming bytes back into flat
8//! `(name, LoraValue)` records ready to feed into Cypher `CREATE`
9//! statements (see [`RowMapping`]).
10//!
11//! The crate has no dependency on the database engine itself. It
12//! deals only with the value model and the on-disk formats. The
13//! import/export *driver* (which actually executes Cypher) lives in
14//! `lora-database::io` and re-uses these codecs.
15
16mod csv;
17mod format;
18mod json_array;
19mod jsonl;
20mod mapping;
21mod value_json;
22
23pub use csv::{CsvDecoder, CsvEncoder, StreamingCsvDecoder};
24pub use format::{
25    downcast_row_parse_error, invalid_data, row_parse_io_error, write_all_rows, Format, RowDecoder,
26    RowEncoder, RowParseError, StreamingRowDecoder, RAW_SAMPLE_MAX_CHARS,
27};
28pub use json_array::{JsonArrayDecoder, JsonArrayEncoder, StreamingJsonArrayDecoder};
29pub use jsonl::{JsonlDecoder, JsonlEncoder, StreamingJsonlDecoder};
30pub use mapping::{
31    parameterized_create_for_node, parameterized_create_for_relationship, ColumnSpec, RowMapping,
32};
33pub use value_json::{lora_value_from_json, lora_value_to_json};