HydraCache 0.31.0
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-dieselfor blocking Diesel loaders wrapped in the common
DbCachequery-cache model. - Add
hydracache-seaormfor async SeaORM loaders wrapped in the same
DbCachequery-cache model. - Re-export
HydraCacheEntityandquery_cache_policy!from both new adapter
crates, matching the SQLx adapter ergonomics. - Add
POST /demo/query/users/{id}/orm-comparisonto 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-callcache, 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-localFull workspace gate passed locally:
cargo fmt --all -- --checkcargo check --workspace --all-targets --lockedcargo test --workspace --all-targets --lockedcargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --doc --workspace --lockedRUSTDOCFLAGS='-D warnings' cargo doc --workspace --no-deps --locked