Skip to content

HydraCache 0.31.0

Choose a tag to compare

@github-actions github-actions released this 13 Jul 16:04
· 1532 commits to main since this release

HydraCache 0.31.0

Status: release candidate; local release gate passed.

0.31.0 focuses on database adapter parity. The release adds Diesel and
SeaORM-facing crates while keeping hydracache-db database-neutral and keeping
SQLx, Diesel, and SeaORM execution models separate.

Highlights

  • Add hydracache-diesel for blocking Diesel loaders wrapped in the common
    DbCache query-cache model.
  • Add hydracache-seaorm for async SeaORM loaders wrapped in the same
    DbCache query-cache model.
  • Re-export HydraCacheEntity and query_cache_policy! from both new adapter
    crates, matching the SQLx adapter ergonomics.
  • Add POST /demo/query/users/{id}/orm-comparison to the sandbox/OpenAPI
    surface. It exercises SQLx, Diesel, and SeaORM-style cache descriptors
    against the same selected sandbox backing row and reports first-call
    loader, second-call cache, loader-call deltas, tags, and pass/fail state.
  • Extend package verification, post-publish consumer checks, and the GitHub
    post-publish workflow for the new crates.

Intended Shape

use hydracache::HydraCache;
use hydracache_diesel::{DieselCache, DieselQueryExt};

# async fn example() -> hydracache_diesel::Result<()> {
let queries = DieselCache::new(HydraCache::local().build(), "diesel");

let user_name = queries
    .entity::<String>("user", 42)
    .collection_tag("users")
    .diesel_first(move || Ok::<_, hydracache_diesel::diesel::result::Error>("Ada".to_owned()))
    .await?;

assert_eq!(user_name, "Ada");
# Ok(())
# }
use hydracache::HydraCache;
use hydracache_seaorm::{SeaOrmCache, SeaOrmQueryExt};

# async fn example() -> hydracache_seaorm::Result<()> {
let queries = SeaOrmCache::new(HydraCache::local().build(), "seaorm");

let user_name = queries
    .entity::<String>("user", 42)
    .collection_tag("users")
    .sea_one(|| async { Ok::<_, hydracache_seaorm::sea_orm::DbErr>(Some("Ada".to_owned())) })
    .await?;

assert_eq!(user_name, Some("Ada".to_owned()));
# Ok(())
# }

See
the 0.31.0 plan
for the implementation checklist.

Focused Verification

cargo test -p hydracache-diesel --locked
cargo test -p hydracache-seaorm --locked
cargo test -p hydracache-sandbox --lib --locked openapi_document_describes_demo_and_actuator_routes
cargo test -p hydracache-sandbox --lib --locked memory_sandbox_routes_exercise_cache_and_actuator
cargo test -p hydracache-sandbox --lib --locked sqlite_memory_sandbox_routes_use_real_database
cargo test --doc -p hydracache-diesel --locked
cargo test --doc -p hydracache-seaorm --locked
.\scripts\verify-crates-io-consumer.ps1 -Version 0.31.0 -LocalPath . -WorkDir target\consumer-check-0.31.0-local

Full workspace gate passed locally:

  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets --locked
  • cargo test --workspace --all-targets --locked
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • cargo test --doc --workspace --locked
  • RUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps --locked