pub struct ProxyConfig {Show 32 fields
pub listen_address: String,
pub admin_address: String,
pub admin_token: Option<String>,
pub tr_enabled: bool,
pub tr_mode: TrMode,
pub pool: PoolConfig,
pub pool_mode: PoolModeConfig,
pub load_balancer: LoadBalancerConfig,
pub health: HealthConfig,
pub nodes: Vec<NodeConfig>,
pub tls: Option<TlsConfig>,
pub write_timeout_secs: u64,
pub plugins: PluginToml,
pub hba: Vec<HbaRule>,
pub auth: AuthConfig,
pub mcp: McpConfig,
pub agent_contracts: Vec<AgentContract>,
pub http_gateway: HttpGatewayConfig,
pub mirror: MirrorConfig,
pub branch: BranchConfig,
pub routing_hints: RoutingHintsConfig,
pub rate_limit: RateLimitToml,
pub circuit_breaker: CircuitBreakerToml,
pub analytics: AnalyticsToml,
pub lag_routing: LagRoutingToml,
pub cache: CacheToml,
pub query_rewrite: QueryRewriteToml,
pub multi_tenancy: MultiTenancyToml,
pub schema_routing: SchemaRoutingToml,
pub graphql_gateway: GraphqlGatewayConfig,
pub optimize_unnamed_parse: bool,
pub shutdown_drain_timeout_secs: u64,
}Expand description
Proxy configuration
Fields§
§listen_address: StringListen address for client connections
admin_address: StringAdmin API address
admin_token: Option<String>Bearer token required on admin API requests. When set, every admin
endpoint except liveness probes (/health*, /livez, /readyz)
requires Authorization: Bearer <token>. Absent (default) = open
(current behaviour) — set this for any non-loopback deployment.
tr_enabled: boolEnable TR (Transaction Replay)
tr_mode: TrModeTR mode
pool: PoolConfigConnection pool configuration
pool_mode: PoolModeConfigPool mode configuration (Session/Transaction/Statement)
load_balancer: LoadBalancerConfigLoad balancer configuration
health: HealthConfigHealth check configuration
nodes: Vec<NodeConfig>Backend nodes
tls: Option<TlsConfig>TLS configuration
write_timeout_secs: u64Write timeout during failover (seconds) When primary is unavailable, wait this long for a new primary before returning error
plugins: PluginTomlPlugin system configuration. Only consumed when the wasm-plugins
feature is enabled; on a feature-off build, values are parsed and
ignored so existing configs don’t break.
hba: Vec<HbaRule>pg_hba-style connection admission rules, evaluated in order before any backend connection is opened. Empty (the default) means admit all (current behaviour preserved).
auth: AuthConfigClient authentication mode. Absent/default = pass-through (the proxy relays the client’s auth to the backend, current behaviour).
mcp: McpConfigMCP (Model Context Protocol) agent gateway. Disabled by default.
agent_contracts: Vec<AgentContract>Per-agent SQL contracts (scoped grants). Referenced by id from the
MCP gateway ([mcp] contract). Empty by default.
http_gateway: HttpGatewayConfigHTTP SQL gateway (Neon-serverless-driver compatible). Disabled by default — lets edge/serverless clients run SQL over HTTP.
mirror: MirrorConfigContinuous traffic mirroring to a secondary backend. Disabled by default — the on-ramp to a PG->Nano migration mirror.
branch: BranchConfigInstant branch databases. Disabled by default — provisions CREATE DATABASE … TEMPLATE clones through the proxy.
routing_hints: RoutingHintsConfigSQL-comment routing hints (/*helios:route=primary*/). Disabled by
default — when enabled, the proxy parses hints from query SQL and
applies them as a route override that wins over the default verb
routing (but never over a plugin Block). Only consumed when the
routing-hints feature is compiled in; parsed-and-ignored otherwise.
rate_limit: RateLimitTomlMulti-dimensional rate limiting (token bucket + concurrency). Disabled
by default. Only enforced when the rate-limiting feature is compiled
in; parsed-and-ignored otherwise.
circuit_breaker: CircuitBreakerTomlPer-node circuit breaker (trip failing backends out of rotation,
fast-fail while open). Disabled by default. Only enforced when the
circuit-breaker feature is compiled in.
analytics: AnalyticsTomlQuery analytics (fingerprinting, per-query statistics, slow-query log,
pattern detection). Disabled by default. Only active when the
query-analytics feature is compiled in.
lag_routing: LagRoutingTomlReplica-lag-aware routing + read-your-writes. Disabled by default. Only
enforced when the lag-routing feature is compiled in.
cache: CacheTomlQuery-result cache (L1 hot / L2 warm). Disabled by default. Only active
when the query-cache feature is compiled in.
query_rewrite: QueryRewriteTomlSQL query rewriting (rules engine). Disabled by default. Only active
when the query-rewriting feature is compiled in.
multi_tenancy: MultiTenancyTomlMulti-tenancy (per-tenant row isolation via injected predicates).
Disabled by default. Only active when the multi-tenancy feature is
compiled in.
schema_routing: SchemaRoutingTomlSchema/workload-aware routing (route OLAP queries to an analytics node).
Disabled by default. Only active when the schema-routing feature is on.
graphql_gateway: GraphqlGatewayConfigGraphQL-to-SQL gateway (separate HTTP listener). Disabled by default.
Only active when the graphql-gateway feature is compiled in.
optimize_unnamed_parse: boolProxy-side unnamed-Parse promotion (Batch H). When a client re-sends an
identical unnamed extended Parse (the dominant pgbench/ORM pattern),
the proxy skips forwarding it to a backend that already holds that exact
unnamed statement and synthesizes the ParseComplete locally — cutting
the per-cycle re-Parse overhead. Default on; a kill-switch for drivers
that somehow depend on the redundant round trip.
shutdown_drain_timeout_secs: u64How long a graceful binary-handoff drain (SIGUSR2) keeps serving
in-flight connections before the old process exits (Batch H). After this
many seconds, any still-open connections are dropped so the handoff
completes in bounded time. Overridable at runtime via the
HELIOS_DRAIN_TIMEOUT_SECS env var.
Implementations§
Source§impl ProxyConfig
impl ProxyConfig
Sourcepub fn write_timeout(&self) -> Duration
pub fn write_timeout(&self) -> Duration
Get write timeout as Duration
Sourcepub fn add_node(&mut self, host_port: &str, role: &str) -> Result<()>
pub fn add_node(&mut self, host_port: &str, role: &str) -> Result<()>
Add a node from host:port string
Sourcepub fn primary_node(&self) -> Option<&NodeConfig>
pub fn primary_node(&self) -> Option<&NodeConfig>
Get primary node
Sourcepub fn standby_nodes(&self) -> Vec<&NodeConfig>
pub fn standby_nodes(&self) -> Vec<&NodeConfig>
Get standby nodes
Sourcepub fn enabled_nodes(&self) -> Vec<&NodeConfig>
pub fn enabled_nodes(&self) -> Vec<&NodeConfig>
Get all enabled nodes
Trait Implementations§
Source§impl Clone for ProxyConfig
impl Clone for ProxyConfig
Source§fn clone(&self) -> ProxyConfig
fn clone(&self) -> ProxyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProxyConfig
impl Debug for ProxyConfig
Source§impl Default for ProxyConfig
impl Default for ProxyConfig
Source§impl<'de> Deserialize<'de> for ProxyConfig
impl<'de> Deserialize<'de> for ProxyConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ProxyConfig
impl RefUnwindSafe for ProxyConfig
impl Send for ProxyConfig
impl Sync for ProxyConfig
impl Unpin for ProxyConfig
impl UnsafeUnpin for ProxyConfig
impl UnwindSafe for ProxyConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more