aboutsummaryrefslogtreecommitdiffstats
path: root/src/sqlite.rs
AgeCommit message (Collapse)Author
2022-03-27Add license (GNU GPLv3+)v0.0.1Teddy Wing
2022-03-23get_column_names(): Add documentationTeddy Wing
2022-03-21Add placeholders for code documentation remindersTeddy Wing
2022-03-21get_column_names(): Use `HashSet` instead of `HashMap`Teddy Wing
This saves us from having to declare and use a vestigial unit struct value for the hash. In retrospect, I could have used the unit type instead of creating a unit struct, but this is even cleaner. Only a couple hours ago learned that `HashSet` exists.
2022-03-21sqlite: Remove unused `affinity()` functionTeddy Wing
Turns out I didn't need this. The `ToSql` and `FromSql` type conversion traits were what I needed instead to convert between YAML and SQLite types.
2022-03-21get_column_names: Idea for column name storageTeddy Wing
I just learned about `HashSet`, and it looks like a cleaner way to do exactly what I was trying to do with `HashMap`.
2022-03-21Add a couple of notes for code cleanupTeddy Wing
2022-03-14Add `table_primary_key_column()`Teddy Wing
Add a function to get the column name of the table's primary key. This allows us to use a primary key value given by the user while saving users the trouble of having to input the primary key column name. We likely still want to offer the option of passing in a primary key column name in case this function can't determine the table's primary key, or if the table has a `UNIQUE` column we can query but no primary key.
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-13get_column_names(): Remove `unwrap()`sTeddy Wing
Return a `Result` and wrap errors in a `thiserror` struct.
2022-03-13sqlite::Zero: Change to unit struct syntaxTeddy Wing
Found some documentation that reminded me how unit structs are written. Change this definition as that makes more sense.
2022-03-12get_column_names(): Get table name from argumentTeddy Wing
Remove the hard-coded table name.
2022-03-12Move `get_column_names()` to `sqlite` moduleTeddy Wing
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