Skip to main content

Crate pylon_value

Crate pylon_value 

Source
Expand description

A purpose-built, self-describing value tree for decoded Postgres rows.

Not serde_json::Value (would blur int64 vs float64 vs decimal vs uuid — real distinctions PyQL’s own type system preserves) and not raw serialization-of-arbitrary-PyObject (Rust has no way to serialize an arbitrary registered Python dataclass — those only exist Python-side). Instead, this sits at the same layer pylon.query.deserialize()’s _decode() consumes today: already decoded from Postgres wire format (never raw bytes), but still generic/positional, not yet hydrated into a user class.

This is the shared decode target for both pylon-cache (stores it, serialized via rkyv) and pylon-pgcon (the Postgres driver — decodes wire bytes straight into this same representation) — the whole point being one decode path regardless of whether a result came fresh from Postgres or from the LMDB cache. Deliberately has no dependency on pylon-core, pyo3, or any I/O crate: it’s just the value shape.

Serialized with rkyv (zero-copy) rather than bincode — bincode is effectively unmaintained upstream (its 3.0.0 release is a deliberate compile_error! protest, forcing anyone pinned loosely onto the archived 2.x line).

Structs§

ArchivedCachedEntry
An archived CachedEntry
CachedEntry
One cache entry: the cached rows plus the tags a write to any of which must invalidate it — stored together so invalidation never needs a second lookup to find out what a key was tagged with.
CachedEntryResolver
The resolver for an archived CachedEntry

Enums§

ArchivedDecodedValue
An archived DecodedValue
DecodedValue
DecodedValueResolver
The resolver for an archived DecodedValue