Skip to content

Quickstart

You’ll need an editor account (an admin invites you) and a PostgreSQL database Flux can reach. The example uses an orders table with id, customer_id, status, amount and currency; use any table you have.

  1. Open Connections and press New connection.
  2. Choose PostgreSQL, give it the key shop, and fill in host, database, username and password.
  3. Press Test connection to check Flux can reach the database and sign in.
  4. Press Create connection.

The password is encrypted as soon as it’s saved; nobody can read it back, including you.

  1. Open Pipelines, type “Paid orders” under New pipeline and press Create.
  2. From the palette on the left add an Extract node. In its settings choose the connection shop and the object public.orders.
  3. Add a Filter and connect the extract’s output to it (drag from the node’s right edge to the filter). Set the condition to status = 'paid'.
  4. Add a Calculate and connect the filter to it. Add a field amount_cents with the formula ROUND(amount * 100).
  5. Add a Target, connect it, and set kind dataset, dataset paid_orders and key id.

Select any node and press Preview output to see sample rows and column types at that step. Problems show on the node as you go, naming the field to fix.

  1. Press Save & activate. Flux validates the pipeline and makes this version the one that runs.
  2. Press Run. The run page shows each node’s progress live, then succeeded with the rows written.

Open Datasets → paid_orders. Look up an order by id, scan a range, or run SQL:

SELECT currency, count(*) AS orders, sum(amount_cents) / 100.0 AS total
FROM paid_orders GROUP BY currency ORDER BY total DESC

From an application, create an API key limited to paid_orders and call:

Terminal window
curl -H "Authorization: Bearer $FLUX_KEY" \
"https://flux.nasterra.com/api/datasets/paid_orders/get?id=1042"