HydraCache 0.35.0
HydraCache 0.35.0
0.35.0 is a database production-readiness release. It focuses on making the
existing database result-cache layer safer to adopt in real Rust services
through transaction-safe invalidation guidance, key/tag checklists, adapter
parity coverage, database-focused observability, and release-gate clarity.
Highlights
- Database production-readiness guide for explicit, local-first query-result
caching. - Transaction-safe invalidation examples that invalidate only after successful
commits. - Cache key and tag safety checklist for tenant, authorization, filter,
pagination, sorting, locale, region, feature flag, and time-window dimensions. - Adapter error-context hardening for SQLx, Diesel, SeaORM, and repository
loaders where it can be done without making adapters own query execution. - SQLx reference scenarios for exactly-one, optional, collection, repository,
transaction-owned, negative-cache, and Postgres smoke-test flows. - Diesel and SeaORM parity coverage for common result shapes and failure
behavior. - Database-cache observability guidance that maps core counters to loader
avoidance, single-flight activity, invalidation, stale fallback, and load
failures. - Sandbox production-readiness demo path for miss, hit, update, rollback,
invalidation, reload, and diagnostics flows.
Changes
- Added
docs/DB_PRODUCTION_READINESS.mdas the central production checklist
for database result caching. - Linked the database readiness guide from the README and policy guide.
- Tracked the
0.35.0implementation plan under
docs/plans/V0_35_DATABASE_PRODUCTION_READINESS_PLAN.md. - Added policy-guide coverage for tenant, permission, escaped filter,
pagination, sorting, collection-tag, and unsafe-key documentation scenarios. - Added transaction-safe invalidation tests for failed writes, rollback,
committed update, committed insert, committed delete, and repeated
invalidation. - Added
DbOperationContext,DbAdapterKind, andDbResultShapeso
database-cache errors include adapter, operation, namespace, key, and result
shape context. - Labeled SQLx, Diesel, and SeaORM helper errors with adapter-specific result
shapes while keeping the database libraries responsible for typed database
errors. - Expanded
DbCacheError::MissingKeywith adapter, namespace, and result-shape
fields. This is a pre-1.0 diagnostic API adjustment; callers matching the
variant should use..for forward-compatible pattern matches. - Strengthened SQLx SQLite reference coverage for transaction commit/rollback
invalidation timing and SQLx loader-failure retry/context behavior. - Added Diesel and SeaORM transaction timing parity tests for rollback,
commit-then-invalidate, and cached-value reload behavior. - Added DB-cache observability contract guidance and database-neutral
diagnostics tests for hit/miss/load counters, single-flight joins,
invalidation counts, stale load discard, and stale fallback after loader
failure.
Verification
This release should pass:
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.\scripts\verify-release-readiness.ps1 -Version 0.35.0 -RunGatecargo test -p hydracache-db --lockedcargo test -p hydracache-sqlx --lockedcargo test -p hydracache-diesel --lockedcargo test -p hydracache-seaorm --lockedcargo test --doc -p hydracache-db --lockedcargo test --doc -p hydracache-sqlx --lockedcargo test --doc -p hydracache-diesel --lockedcargo test --doc -p hydracache-seaorm --lockedcargo package -p hydracache-db --allow-dirtycargo package -p hydracache-sqlx --allow-dirtycargo package -p hydracache-diesel --allow-dirtycargo package -p hydracache-seaorm --allow-dirty
Optional real Postgres coverage should pass or skip gracefully when Docker is
not available:
cargo test -p hydracache-sqlx --test postgres_testcontainers --locked -- --nocapture