Skip to content

Commit

Permalink
v0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Colonial-Dev committed May 14, 2024
1 parent 045a625 commit 3119469
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v0.10.0
- (Routine Maintenance) Updated `rusqlite` from `0.30.0` to `0.31.0`.
- This is a *breaking change,* requiring you to upgrade your `rusqlite` to match - trying to link against two different copies of `libsqlite3` will cause a compile fail.

### v0.9.0
- (Routine Maintenance) Updated `rusqlite` from `0.29.0` to `0.30.0`.
- This is a *breaking change,* requiring you to upgrade your `rusqlite` to match - trying to link against two different copies of `libsqlite3` will cause a compile fail.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ members = [
]

[workspace.package]
version = "0.9.0"
version = "0.10.0"
authors = ["Colonial"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The pain points I tried to fix were:
- Needing to allocate and juggle a slice of `String` column names to efficiently deserialize rows - probably due to `serde` limitations?
- Exemplar statically knows what columns to expect, so `from_row` requires no extra inputs and makes no superfluous allocations.
- Odd design choices for field-less `enum`s - they are inefficiently serialized as `TEXT` instead of `INTEGER`. This was nice for debugging, but I figured the faster option should be Exemplar's default.
- `to_params_named(&row1).unwrap().to_slice().as_slice()`
- `to_params_named(&row1).unwrap().to_slice().as_slice()` doesn't quite roll off the tongue (although this is likely `serde` weirdness showing up again.)
- Equivalent to `row1.insert(&conn)` or `row1.insert_with(&stmt)` in Exemplar.
- General `serde` overhead popping up, both at compile and runtime.
- Benchmarking shows that `serde_rusqlite` is ~25% slower on insert operations compared to Exemplar.
Expand Down
12 changes: 5 additions & 7 deletions exemplar/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
exemplar_proc_macro = { version = "0.7.1" }
rusqlite = "0.30.0"
rusqlite = "0.31.0"

[dev-dependencies]
anyhow = "1.0.75"
criterion = "0.5.1"
serde = "1.0.189"
# Temporarily disabled; uses outdated rusqlite version.
# serde_rusqlite = "0.33.1"
serde_rusqlite = "0.35.0"

[[bench]]
name = "binding_strategies"
Expand All @@ -33,10 +32,9 @@ harness = false
name = "query_exemplar"
harness = false

# Temporarily disabled; see above.
# [[bench]]
# name = "query_serde"
# harness = false
[[bench]]
name = "query_serde"
harness = false

[[bench]]
name = "query_manual"
Expand Down
12 changes: 3 additions & 9 deletions exemplar_proc_macro/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,7 @@ pub fn get_check_path(ast: &DeriveInput) -> Option<String> {
attr.path().is_ident("check")
});

let Some(table) = table else {
return None;
};
let table = table?;

let Ok(Lit::Str(str)) = table.parse_args::<Lit>() else {
abort!(
Expand Down Expand Up @@ -148,9 +146,7 @@ pub fn get_bind_path(field: &Field) -> Option<Path> {
attr.path().is_ident("bind")
});

let Some(bind) = bind else {
return None;
};
let bind = bind?;

let Ok(path) = bind.parse_args::<Path>() else {
abort!(
Expand All @@ -172,9 +168,7 @@ pub fn get_extr_path(field: &Field) -> Option<ExprPath> {
attr.path().is_ident("extr")
});

let Some(extr) = extr else {
return None;
};
let extr = extr?;

let Ok(path) = extr.parse_args::<ExprPath>() else {
abort!(
Expand Down

0 comments on commit 3119469

Please sign in to comment.