Skip to content

Commit

Permalink
prepare v0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Werner Braun committed Dec 5, 2024
1 parent cf0161c commit d1c0a7a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 13 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org).

## Unreleased

## 0.1.4 - 2024-12-05

- MSRV 1.81
- bump virtue to 0.0.18
- bump dev dependencies
- small refactorings after extended lint checks
- doc fixed typo + assertion

## 0.1.3 - 2024-07-05

- tests extended
Expand Down
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "wb_sqlite"
version = "0.1.3"
version = "0.1.4"
authors = ["Werner Braun <[email protected]>"]
edition = "2021"
# sqlx-core needs 1.74 impl_trait_projections
rust-version = "1.74"
# idna 1.0.3 needs 1.81 error in core
rust-version = "1.81"
description = "Derive map of struct/field to SQLite table/column. Generate const/fn for create-table, insert, select, update."
repository = "https://github.com/wbcat/wb_sqlite"
license = "MIT OR Apache-2.0"
Expand All @@ -16,10 +16,10 @@ proc-macro = true

[dependencies]
convert_case = "0.6.0"
virtue = "0.0.17"
virtue = "0.0.18"

[dev-dependencies]
# sqlx 0.7.4 needs rusqlite 0.30.0
rusqlite = { version = "0.30.0", features = ["bundled"] }
sqlx = { version = "0.7.4", features = ["sqlite", "runtime-tokio"] }
tokio = { version = "1.38.0", features = ["rt", "macros"] }
# sqlx 0.8.2 needs rusqlite 0.32.1
rusqlite = { version = "0.32.1", features = ["bundled"] }
sqlx = { version = "0.8.2", features = ["sqlite", "runtime-tokio"] }
tokio = { version = "1.42.0", features = ["rt", "macros"] }
14 changes: 12 additions & 2 deletions Cranky.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Rust 1.79
# Rust 1.83
# https://crates.io/crates/cargo-cranky
# https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html
# https://rust-lang.github.io/rust-clippy/master/
Expand Down Expand Up @@ -29,7 +29,6 @@ warn = [
"unused_qualifications",
"variant_size_differences",
# clippy
"clippy::allow_attributes",
"clippy::allow_attributes_without_reason",
"clippy::as_ptr_cast_mut",
"clippy::as_underscore",
Expand All @@ -39,6 +38,7 @@ warn = [
"clippy::borrow_as_ptr",
"clippy::branches_sharing_code",
"clippy::cast_lossless",
"clippy::cfg_not_test",
"clippy::clear_with_drain",
"clippy::clone_on_ref_ptr",
"clippy::cloned_instead_of_copied",
Expand Down Expand Up @@ -102,6 +102,7 @@ warn = [
"clippy::manual_assert",
"clippy::manual_c_str_literals",
"clippy::manual_instant_elapsed",
"clippy::manual_is_power_of_two",
"clippy::manual_is_variant_and",
"clippy::manual_let_else",
"clippy::manual_ok_or",
Expand Down Expand Up @@ -131,11 +132,13 @@ warn = [
"clippy::needless_raw_string_hashes",
"clippy::needless_raw_strings",
"clippy::negative_feature_names",
"clippy::non_zero_suggestions",
"clippy::nonstandard_macro_braces",
"clippy::option_as_ref_cloned",
"clippy::option_if_let_else",
"clippy::option_option",
"clippy::path_buf_push_overwrite",
"clippy::pathbuf_init_then_push",
"clippy::ptr_as_ptr",
"clippy::ptr_cast_constness",
"clippy::pub_underscore_fields",
Expand All @@ -149,11 +152,14 @@ warn = [
"clippy::redundant_type_annotations",
"clippy::ref_as_ptr",
"clippy::ref_binding_to_reference",
"clippy::ref_option",
"clippy::ref_option_ref",
"clippy::ref_patterns",
"clippy::rest_pat_in_fully_bound_structs",
"clippy::same_functions_in_if_condition",
"clippy::same_name_method",
"clippy::set_contains_or_insert",
"clippy::single_char_pattern",
"clippy::single_match_else",
"clippy::str_split_at_newline",
"clippy::str_to_string",
Expand All @@ -164,6 +170,7 @@ warn = [
"clippy::suspicious_operation_groupings",
"clippy::suspicious_xor_used_as_pow",
"clippy::tests_outside_test_module",
"clippy::too_long_first_doc_paragraph",
"clippy::trailing_empty_array",
"clippy::trait_duplication_in_bounds",
"clippy::transmute_ptr_to_ptr",
Expand All @@ -186,12 +193,15 @@ warn = [
"clippy::unreadable_literal",
"clippy::unseparated_literal_suffix",
"clippy::unused_peekable",
"clippy::unused_result_ok",
"clippy::unused_rounding",
"clippy::unused_self",
"clippy::use_self",
"clippy::used_underscore_binding",
"clippy::used_underscore_items",
"clippy::useless_let_if_seq",
"clippy::verbose_file_reads",
"clippy::while_float",
"clippy::wildcard_dependencies",
"clippy::wildcard_imports",
"clippy::zero_sized_map_values",
Expand Down
4 changes: 2 additions & 2 deletions src/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fn gen_struct(
let mut gen_impl = generator.generate_impl();
if !pk.is_empty() {
gen_impl
.generate_fn(&format!("get_by_{pk}"))
.generate_fn(format!("get_by_{pk}"))
.as_async()
.with_arg(&pk, &pk_typ)
.with_arg("exec", "impl ::sqlx::SqliteExecutor<'_>")
Expand All @@ -84,7 +84,7 @@ fn gen_struct(
unique_typ.pop();
for (col, typ) in std::iter::zip(unique.split(','), unique_typ.split(',')) {
gen_impl
.generate_fn(&format!("get_by_{col}"))
.generate_fn(format!("get_by_{col}"))
.as_async()
.with_arg(col, typ)
.with_arg("exec", "impl ::sqlx::SqliteExecutor<'_>")
Expand Down
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use virtue::prelude::TokenStream;
/// name: String,
/// #[sql(constraint = "REFERENCES parent(id) ON UPDATE RESTRICT ON DELETE RESTRICT")]
/// mother: i64,
/// #[sql(constraint = "rEFERENCES parent(id) ON UPDATE RESTRICT ON DELETE RESTRICT")]
/// #[sql(constraint = "REFERENCES parent(id) ON UPDATE RESTRICT ON DELETE RESTRICT")]
/// father: i64,
/// #[sql(constraint = "REFERENCES human(id) ON UPDATE RESTRICT ON DELETE RESTRICT")]
/// owner: i64,
Expand All @@ -36,6 +36,7 @@ use virtue::prelude::TokenStream;
/// Cat::CREATE_INDEX_SQL,
/// concat!(
/// "CREATE INDEX IF NOT EXISTS cat_mother_idx ON cat(mother); ",
/// "CREATE INDEX IF NOT EXISTS cat_father_idx ON cat(father); ",
/// "CREATE INDEX IF NOT EXISTS cat_owner_idx ON cat(owner); "
/// )
/// );
Expand Down

0 comments on commit d1c0a7a

Please sign in to comment.