1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Postgres-backed log writer.
//!
//! The `logs.*` schema (defined in `schema.sql`) is a hybrid:
//!
//! - **Six tier blob tables** (request + response × agent / vector /
//! function) store the full chunk body as JSONB. Requests are
//! written once on first chunk arrival; responses get UPDATEd per
//! tick when their body changes.
//! - **Fourteen streaming-content tables** carry the per-message,
//! per-part incrementally-updating content yielded by the SDK's
//! chunk-type `log_rows()` iterators.
//!
//! Diff detection: every row written has a deterministic PK shape
//! `(response_id, index[, sub_index])`. The writer holds a shadow map
//! keyed identically and hashes each row's body columns. Three
//! verdicts come out: `Insert` (first sight), `Update` (changed
//! body), `Skip` (unchanged). The SQL helpers in [`write`] dispatch
//! flat INSERT or UPDATE per verdict — no `ON CONFLICT` ambiguity.
//!
//! The writer is the sole caller and is single-instance per stream,
//! so the shadow's verdict is authoritative — concurrent races on
//! the same row id can't happen.
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;
pub use *;