Skip to main content

Module data_lake_connection

Module data_lake_connection 

Source

Structs§

DataLakeConnection
A connection to the data lake, including a database pool and a blob storage client.
ReadOnlyFallback
Shared handle to a WritablePolicy::Prefer pool’s fallback state. See Self::on_connect and Self::on_acquire for the decisions it drives.

Enums§

WritablePolicy
Which write-session guarantee a lake connection pool enforces on every connection it hands out.

Constants§

FALLBACK_AFTER
How long a WritablePolicy::Prefer pool keeps rejecting read-only connections before falling back, once no writable connection has succeeded since the last one (or since startup).
PROBE_INTERVAL
How often a WritablePolicy::Prefer pool that has fallen back to a read-only connection evicts a pooled one to re-probe for a writable primary.

Functions§

connect_to_data_lake
Connects to the data lake.
is_read_only
True when setting (a Postgres transaction_read_only value, as read by SHOW transaction_read_only) marks the session as read-only. Anything other than "on" counts as writable: this matches libpq’s target_session_attrs=read-write on pre-14 servers, and an unexpected value shouldn’t take the service down.
is_read_only_violation
Finds a sqlx::Error carrying SQLSTATE 25006 (cannot execute ... in a read-only transaction) anywhere in err’s chain – the error a write raises when its connection turned read-only mid-query, after already passing this crate’s connect/acquire checks (e.g. an instance demoted between before_acquire and the query, or a WritablePolicy::Prefer pool that fell back to a replica on purpose).
pool_options
Pool options for a pool whose write-session guarantee is policy – see WritablePolicy.
read_write_pool_options
Pool options for a pool that must reach a writable primary – pool_options with WritablePolicy::Require.