valence-backend-postgres
Postgres wire DatabaseBackend adapter.
Audience
| Reader | Use this crate for |
|---|---|
| App developers | Enable via valence feature postgres |
| Host integrators | Remote Postgres at boot |
| Adapter authors | Wire builder + from_env_defaults pattern |
pub const ENGINE_ID: &str = "postgres";
Environment
| Variable | Meaning |
|---|---|
DATABASE_URL |
Postgres connection URL (required unless .url() is set) |
Wiring
use Arc;
use ;
// Explicit:
let backend = connect.await?;
// Or env:
let backend = from_env.await?;
let valence = builder
.add_backend
.build?;
Builder: PostgresBackend::builder().url(...).from_env_defaults().build().await?
Runnable (skips when unset):
DATABASE_URL=postgres://localhost/valence \
See DatabaseBackend rustdoc (cargo doc -p uf-valence-core --open).