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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! §Fase 118.b.3 — the §Fase 96 pooler-topology decision, driver-free.
//!
//! `connections_release_across_cognition` is a DEPLOYMENT question — what kind
//! of pooler sits in front of Postgres — answered by reading one environment
//! variable and comparing two strings. It lived in `store/postgres_backend.rs`,
//! so the eager-pin loops in `runner.rs` had to reach into the driver module to
//! ask "should I even try to pin?" — a question that must be answerable *before*
//! any driver is involved, and in a build that has none.
//!
//! Part of the same cluster as [`super::error`] and [`super::row`]: three
//! general concepts parked in the first module that needed them. See
//! `store/error.rs` for the full list.
//!
//! **This module must never acquire a dependency.**
/// §Fase 96.a — is eager §37.x.j connection pinning enabled for this
/// deployment? Read ONCE from `AXON_DB_POOLER_MODE` and cached (the pooler
/// topology is fixed for a process's life):
/// - `transaction` (default, or unset) → pinning ON (unchanged behavior;
/// a transaction-mode pooler needs one connection held per flow so
/// consecutive ops keep the same physical backend / prepared-statement
/// session).
/// - `session` | `direct` → pinning OFF. Each pool connection is already a
/// coherent session, so store ops acquire per-op and RELEASE the
/// connection between them — including across a flow's cognition (LLM)
/// steps, so a slow flow never holds a scarce connection idle under a
/// bounded pooler. Doctrine `connections_release_across_cognition`.
/// The pure decision (testable without the env/`OnceLock`): pinning is ON for
/// every mode EXCEPT `session`/`direct` (case/space-insensitive). An unset or
/// unrecognised value defaults to ON (`transaction`) — zero regression for
/// existing deployments.