ironflow-ops-postgres
PostgreSQL integration for Ironflow workflows, powered by sqlx.
Provides PostgreSQL operations (queries, schema inspection, maintenance, admin tasks) as tracked workflow steps with connection pooling.
Usage
[]
= "0.1"
Build a client
use PostgresClient;
// From a workflow step (reads postgres_url from the secret store)
let pg = from_context.await?;
// Explicit connection URL
let pg = connect.await?;
Tracked operations
use PostgresClient;
use Query;
let pg = from_context.await?;
let query = new
.bind_bool;
let output = ctx.operation.await?;
Direct pool access
use PostgresClient;
let pg = from_context.await?;
let pool = pg.pool;
// Use sqlx directly with the pool
Available operations
| Module | Operations |
|---|---|
query |
Query (SELECT), query one, query scalar |
execute |
Execute (INSERT, UPDATE, DELETE), execute many |
schema |
List tables, columns, indexes, constraints, extensions |
maintenance |
Vacuum, analyze, reindex |
admin |
Connections (list, terminate), database size, table stats |
Authentication
Register postgres_url in your workflow's secret store:
secrets:
- name: postgres_url
env: DATABASE_URL # e.g. postgres://user:pass@host:5432/db