ironflow-ops-postgres 0.1.2

PostgreSQL operations for Ironflow workflows, powered by sqlx
Documentation

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

[dependencies]
ironflow-ops-postgres = "0.1"

Build a client

use ironflow_ops_postgres::PostgresClient;

// From a workflow step (reads postgres_url from the secret store)
let pg = PostgresClient::from_context(&ctx).await?;

// Explicit connection URL
let pg = PostgresClient::connect("postgres://user:pass@localhost/mydb").await?;

Tracked operations

use ironflow_ops_postgres::PostgresClient;
use ironflow_ops_postgres::query::Query;

let pg = PostgresClient::from_context(&ctx).await?;

let query = Query::new(&pg, "SELECT id, name FROM users WHERE active = $1")
    .bind_bool(true);

let output = ctx.operation("list-active-users", &query).await?;

Direct pool access

use ironflow_ops_postgres::PostgresClient;

let pg = PostgresClient::from_context(&ctx).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