Skip to main content

Crate omnia_postgres

Crate omnia_postgres 

Source
Expand description

§omnia-postgres

crates.io docs.rs

PostgreSQL backend for the Omnia WASI runtime, implementing the wasi-sql interface.

Uses deadpool-postgres connection pooling with optional TLS via rustls. Supports multiple named pools for connecting to several databases from a single runtime.

MSRV: Rust 1.93

§Configuration

VariableRequiredDefaultDescription
POSTGRES_URLyesDefault pool connection URI
POSTGRES_POOL_SIZEno10Default pool size
POSTGRES_POOLSnoComma-separated extra pool names
POSTGRES_URL__<NAME>per poolURI for named pool
POSTGRES_POOL_SIZE__<NAME>noinheritedPool size for named pool

§Usage

use omnia::Backend;
use omnia_postgres::Client;

let options = omnia_postgres::ConnectOptions::from_env()?;
let client = Client::connect_with(options).await?;

§License

MIT OR Apache-2.0

Structs§

Client
Postgres client
ConnectOptions
Connection options for the PostgreSQL backend.
PoolEntry
A named connection pool entry.