Task and prerequisites

Read a limited set of SQL records with one SELECT query and create a verification CSV.

This example uses demonstration data and settings. Validate the expected result in your own environment before connecting production destinations. Identifiers demo_* are illustrative: select your own training connections or sources in the editor. The JSON below shows the block and connection structure, not a ready-to-transfer flow archive.

Connection demo_sql is an illustrative training SQL database. All addresses, users and secrets are configured in the connection manager, not in graph JSON.

Training input data

order_idstatusamount
101open120
102closed70
103open30

Blocks, connections and exact settings

Explanatory diagramEnlarge ↗13. SQL: select open orders. Example 13 topology: 2 blocks, 1 connection. Node identifiers and ports from the configured graph are preserved.
Flow diagram 13

Example 13 topology: 2 blocks, 1 connection. Node identifiers and ports from the configured graph are preserved.

Add the listed blocks in the designer, open each block's properties and set these values. Names demo_* identify training sources and connections.

BlockSetting
1
Connection
sql
  • Role: source
  • Connection: demo_sql
  • External object:
    • Read method: query
    • Query: SELECT order_id, amount FROM demo_orders WHERE status = 'open' ORDER BY order_id
2
Data export
out
  • Format: csv
  • File name: open_orders
  • Purpose: download
  • Delimiter: ;
  • Time zone: Europe/Kyiv

Port connections

  • sql out → out in
Complete graph configuration as JSON
{
  "version": 3,
  "nodes": [
    {
      "id": "sql",
      "type": "connection",
      "label": "sql",
      "config": {
        "role": "source",
        "connection_id": "demo_sql",
        "external": {
          "source_mode": "query",
          "query": "SELECT order_id, amount FROM demo_orders WHERE status = 'open' ORDER BY order_id"
        }
      }
    },
    {
      "id": "out",
      "type": "export",
      "label": "out",
      "config": {
        "format": "csv",
        "filename": "open_orders",
        "destination": "download",
        "delimiter": ";",
        "timezone": "Europe/Kyiv"
      }
    }
  ],
  "edges": [
    {
      "source": "sql",
      "target": "out",
      "source_port": "out",
      "target_port": "in"
    }
  ]
}

Expected result

order_idamount
101120
10330

Two records, with amount totaling 150. ORDER BY makes verification-file ordering deterministic.

Run and verify

  1. Create demo_orders with the illustrated rows in the training database beforehand, along with connection demo_sql.
  2. Test the connection and select query mode in the source block.
  3. Run and verify IDs 101/103; closed record 102 must not appear in the result.

Common errors

  • Reading allows one nonmutating query; do not insert DDL or multiple statements.
  • Table/schema names depend on your database; use schema.demo_orders if required.
  • Without ORDER BY, SQL result ordering is not guaranteed.