aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib.rs
AgeCommit message (Collapse)Author
2022-03-27Add license (GNU GPLv3+)v0.0.1Teddy Wing
2022-03-23lib: Add documentation for `Error` typeTeddy Wing
2022-03-21Add placeholders for code documentation remindersTeddy Wing
2022-03-21lib: Move `insert()` to a new moduleTeddy Wing
Split this code out into its own module like we've done with `select()`. Feels better organised this way.
2022-03-21Add a couple of notes for code cleanupTeddy Wing
2022-03-19main: If `primary_key` option is given, select by given column nameTeddy Wing
2022-03-14Idea for selecting a record from the database as YAMLTeddy Wing
2022-03-13yaqlite::Error: Include `rusqlite` error descriptionTeddy Wing
2022-03-13insert(): Remove `unwrap()`sTeddy Wing
Use a new `yaqlite::Error` type. Remove the other error types and use this main error type everywhere. For now, that seems simpler. The real reason why I centralised on one error type is that I wanted a single `Error::Sqlite` variant for both `rusqlite::Error` and `SqliteError` errors. However, I wasn't sure if it's possible to do that with `thiserror`, and I didn't want to bother having to write my own `std::error::Error` impls.
2022-03-13extract(): Remove `unwrap()`sTeddy Wing
2022-03-13get_column_names(): Remove `unwrap()`sTeddy Wing
Return a `Result` and wrap errors in a `thiserror` struct.
2022-03-13insert(): Test that an array of YAML records get insertedTeddy Wing
2022-03-13insert(): Add test for non-array YAML hashTeddy Wing
Test that a plain YAML hash gets inserted even when not wrapped in an array.
2022-03-13insert(): Add a test for nonexistent column handlingTeddy Wing
Check that nonexistent columns are ignored from the input YAML.
2022-03-13insert(): Two new test ideasTeddy Wing
2022-03-13inserts_yaml_in_database(): Generalise test codeTeddy Wing
Extract the test code to a new function so that it can be reused to test other YAML inputs and database records.
2022-03-13yaqlite::insert(): Add testTeddy Wing
Check that the function inserts a record into the database based on a YAML input. Adjust the `extract()` function to take the table name as an argument.
2022-03-12Add an `insert()` function for inserting YAML in databaseTeddy Wing
Make an interface that more cleanly says "insert this YAML into this database".
2022-03-12Move `Yaml` newtype to a new module in library crateTeddy Wing
Separate this code from the main binary file.
2022-03-10Start encoding SQLite affinity rulesTeddy Wing
Need to figure out what to do for NUMERIC affinity since Rusqlite doesn't expose a variant for that pseudo-type.
2022-03-09Idea for getting SQLite type affinity from a type stringTeddy Wing