v0.11.1
HydraCache 0.11.1 Release Notes
HydraCache 0.11.1 is a patch release for public documentation and crate
metadata. It does not change runtime behavior or public API semantics.
Highlights
- Clarified that
CacheEntityandHydraCacheEntitybelong to the
database-neutralhydracache-dblayer. - Kept the
hydracache-sqlxre-exports supported as adapter convenience for
SQLx users. - Updated README examples to show the canonical import boundary.
- Documented that publishing smoke tests may intentionally import through
hydracache-sqlxwhen verifying adapter re-exports.
Canonical Entity Import
Use hydracache-db for database-neutral entity metadata:
use hydracache_db::{CacheEntity, HydraCacheEntity};
use hydracache_sqlx::DbCache;
#[derive(serde::Serialize, serde::Deserialize, HydraCacheEntity)]
#[hydracache(entity = "user", collection = "users", id = i64)]
struct User {
id: i64,
name: String,
}
# async fn example(queries: DbCache) -> hydracache_sqlx::Result<()> {
let user = queries
.for_entity::<User>(42)
.fetch_with(|| async {
Ok::<_, std::io::Error>(User {
id: 42,
name: "Ada".to_owned(),
})
})
.await?;
assert_eq!(user.id, 42);
assert_eq!(User::cache_key_for(&42), "user:42");
assert_eq!(User::collection_tag(), Some("users".to_owned()));
# Ok(())
# }hydracache-sqlx::{CacheEntity, HydraCacheEntity} remains valid for users who
want to depend only on the SQLx adapter crate in application code.
Publish Order
Publish in dependency order:
hydracache-corehydracachehydracache-macroshydracache-dbhydracache-sqlx
Wait for crates.io index propagation between dependent crates.