# omnia-postgres
[](https://crates.io/crates/omnia-postgres)
[](https://docs.rs/omnia-postgres)
`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
| `POSTGRES_URL` | yes | | Default pool connection URI |
| `POSTGRES_POOL_SIZE` | no | `10` | Default pool size |
| `POSTGRES_POOLS` | no | | Comma-separated extra pool names |
| `POSTGRES_URL__<NAME>` | per pool | | URI for named pool |
| `POSTGRES_POOL_SIZE__<NAME>` | no | inherited | Pool size for named pool |
## Usage
```rust,ignore
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