aboutsummaryrefslogtreecommitdiffstats
path: root/src/yaml
AgeCommit message (Collapse)Author
2022-03-27Add license (GNU GPLv3+)v0.0.1Teddy Wing
2022-03-23yaml::write: Add documentationTeddy Wing
2022-03-21sql: Add documentationTeddy Wing
2022-03-21sql: Remove `From` impl for `Yaml` idea commentTeddy Wing
This was obviated by using `Cow::Borrowed` and `Cow::Owned` directly when creating a `Yaml`.
2022-03-21Add placeholders for code documentation remindersTeddy Wing
2022-03-19main: Write YAML to standard outputTeddy Wing
Create an adapter from `std::fmt::Write` to `std::io::Write` based on the following idea in the standard library: https://github.com/rust-lang/rust/blob/master/library/std/src/io/mod.rs#L1634-L1652 Since `yaml_rust::YamlEmitter::new()` requires a `std::fmt::Write`, adapt standard output so the emitter can write to it.
2022-03-19select(): Build a `yaml_rust::yaml::Hash` for each rowTeddy Wing
Instead of my earlier `std::collections::HashMap`, build the type we want to return directly in the row closure. Required copying some data like the column names, but I don't see a way around that. I suppose we could make `yaml_rust::Yaml`s from the column headers in the row closure too instead of copying an existing column header that we otherwise never use. This nearly passes the test I have for this function, but it includes the `id` column in the `Yaml` hash. The primary key column will need to be removed.
2022-03-18select(): Trying to inspect data queried from databaseTeddy Wing
Can't get the info from inside the closure it seems. The row iterator doesn't seem to be looping. Not sure what the story is yet. Maybe I'm not converting the data types correctly.
2022-03-18yaml::sql::Yaml: Make this type `pub(crate)`Teddy Wing
It doesn't need to be completely public.
2022-03-17Yaml: Wrap a `Cow<'_, yaml_rust::Yaml>` instead of `yaml_rust::Yaml`Teddy Wing
This allows us to use a borrowed `yaml_rust::Yaml` for `ToSql` and an owned `yaml_rust::Yaml` for `FromSql`.
2022-03-16select(): Trying to convert a SQLite row to `yaml_rust::Yaml`Teddy Wing
Still a work in progress. Trying to figure out what makes the most sense for converting between the different types in SQLite and YAML. This code still has some compilation errors.
2022-03-13Yaml::to_sql(): Remove `unwrap()`sTeddy Wing
If any value extraction comes back as `None`, convert it to a SQL `Null`.
2022-03-12Move `yaqlite::yaml` to `yaqlite::yaml::sql`Teddy Wing
Want to use `yaqlite::yaml` for the YAML extraction function.