Age | Commit message (Collapse) | Author | |
---|---|---|---|
2022-03-13 | main(): Start adding command line argument parsing | Teddy Wing | |
2022-03-13 | yaqlite::Error: Include `rusqlite` error description | Teddy Wing | |
2022-03-13 | insert(): Remove `unwrap()`s | Teddy 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-13 | extract(): Remove handled TODO | Teddy Wing | |
2022-03-13 | extract(): Remove `unwrap()`s | Teddy Wing | |
2022-03-13 | Yaml::to_sql(): Remove `unwrap()`s | Teddy Wing | |
If any value extraction comes back as `None`, convert it to a SQL `Null`. | |||
2022-03-13 | get_column_names(): Remove `unwrap()`s | Teddy Wing | |
Return a `Result` and wrap errors in a `thiserror` struct. | |||
2022-03-13 | main(): Remove `get_column_names()` call | Teddy Wing | |
That is now moved to `yaqlite::insert()`. | |||
2022-03-13 | sqlite::Zero: Change to unit struct syntax | Teddy Wing | |
Found some documentation that reminded me how unit structs are written. Change this definition as that makes more sense. | |||
2022-03-13 | extract(): Idea for splitting up this function | Teddy Wing | |
2022-03-13 | insert(): Test that an array of YAML records get inserted | Teddy Wing | |
2022-03-13 | insert(): Add test for non-array YAML hash | Teddy Wing | |
Test that a plain YAML hash gets inserted even when not wrapped in an array. | |||
2022-03-13 | insert(): Add a test for nonexistent column handling | Teddy Wing | |
Check that nonexistent columns are ignored from the input YAML. | |||
2022-03-13 | insert(): Two new test ideas | Teddy Wing | |
2022-03-13 | inserts_yaml_in_database(): Generalise test code | Teddy 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-13 | yaqlite::insert(): Add test | Teddy 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-12 | Add an `insert()` function for inserting YAML in database | Teddy Wing | |
Make an interface that more cleanly says "insert this YAML into this database". | |||
2022-03-12 | Move `yaml_extract()` to `yaqlite::yaml::extract()` | Teddy Wing | |
2022-03-12 | Move `yaqlite::yaml` to `yaqlite::yaml::sql` | Teddy Wing | |
Want to use `yaqlite::yaml` for the YAML extraction function. | |||
2022-03-12 | get_column_names(): Get table name from argument | Teddy Wing | |
Remove the hard-coded table name. | |||
2022-03-12 | yaml_extract(): Remove old comments | Teddy Wing | |
2022-03-12 | Move `get_column_names()` to `sqlite` module | Teddy Wing | |
2022-03-12 | get_column_names(): Remove irrelevant comments | Teddy Wing | |
2022-03-12 | get_column_names(): Restore `Zero` value | Teddy Wing | |
Turns out I didn't need the type of the column, so get rid of that value and resume using `Zero`. | |||
2022-03-12 | Move `Yaml` newtype to a new module in library crate | Teddy Wing | |
Separate this code from the main binary file. | |||
2022-03-12 | yaml_extract(): Don't try to insert data for nonexistent columns | Teddy Wing | |
If a hash key in the input YAML does not match one of the column names in the table we're inserting into, ignore that YAML field and use the other columns for insertion. | |||
2022-03-12 | Convert `yaml::Yaml` values to `rusqlite::ToSql` | Teddy Wing | |
This enables us to build a list of params for insertion and insert them into the database. Not sure if `NULL` makes sense for all of these types, but this at least gives us the type conversion necessary to get the YAML values into the SQL query, cool. | |||
2022-03-12 | yaml_extract: Trying to build up a SQL insert statement | Teddy Wing | |
Doesn't work yet as I need a way to convert `Yaml` values to Rusqlite SQL params. | |||
2022-03-10 | Start encoding SQLite affinity rules | Teddy Wing | |
Need to figure out what to do for NUMERIC affinity since Rusqlite doesn't expose a variant for that pseudo-type. | |||
2022-03-09 | Idea for getting SQLite type affinity from a type string | Teddy Wing | |
2022-03-09 | get_column_names(): Add a note to map to the enum type instead of String | Teddy Wing | |
2022-03-09 | get_column_names(): Also get column type | Teddy Wing | |
Creates a map from column name to type. | |||
2022-03-09 | yaml_extract(): Fix code from transaction argument idea | Teddy Wing | |
2022-03-09 | Add TODO for column type | Teddy Wing | |
Want to translate YAML types to SQLite types. | |||
2022-03-09 | Idea for inserting values from YAML into SQLite table | Teddy Wing | |
Need to figure out how to insert `table_columns.len()` values. | |||
2022-03-09 | Check if YAML hash key matches column name | Teddy Wing | |
Possibly ugly passing `table_columns` into `yaml_extract`, but just trying to get things working for now. Query a "people" DB table instead as that matches the test YAML file. | |||
2022-03-09 | get_column_names(): Put column names in a `HashMap` | Teddy Wing | |
Make it easier to find out if a column name exists in the table. | |||
2022-03-08 | get_column_names(): Remove transaction code | Teddy Wing | |
We probably don't even need a transaction for a `SELECT`. Get rid of that code and remove the `mut` on `dbconn` which was only necessary for the transaction. | |||
2022-03-08 | Get column names from SQLite table | Teddy Wing | |
Eliminated the transaction because of a borrow problem. | |||
2022-03-08 | Try extracting YAML data | Teddy Wing | |
2022-03-07 | Try reading and parsing a YAML file | Teddy Wing | |
2022-03-07 | Add notes | Teddy Wing | |
2022-03-07 | New Rust 1.59.0 project | Teddy Wing | |
$ rustc --version rustc 1.59.0 (9d1b2106e 2022-02-23) $ cargo init --bin | |||
2022-03-06 | Idea for a program to convert between YAML and SQLite | Teddy Wing | |