Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
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.
|
|
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.
|
|
I just learned about `HashSet`, and it looks like a cleaner way to do
exactly what I was trying to do with `HashMap`.
|
|
|
|
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.
|
|
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.
|
|
Return a `Result` and wrap errors in a `thiserror` struct.
|
|
Found some documentation that reminded me how unit structs are written.
Change this definition as that makes more sense.
|
|
Remove the hard-coded table name.
|
|
|
|
Need to figure out what to do for NUMERIC affinity since Rusqlite
doesn't expose a variant for that pseudo-type.
|
|
|