Start building

Databases

CSV → normalized database transaction

Read CSV, normalize customer values and build registered SQL statements for one atomic database transaction. Files and database are explicit fixtures in gallery simulation; local adapter tests exercise real SQLite separately.

  • CSV → Database (JDBC/SQL)
  • via Files
  • Advanced
  • 5 min

Last verified 2026-10-31 at f4ce7d0 — simulation fixtures

Try this template in Studio

Studio activation is a one-time payment of USD 20.

Flow

Drawn at build time from the node positions in the template's process definitions. Numbered markers are the walkthrough stages.

Main processCSV → normalized database transaction6 activities

Scroll sideways to see the whole flow.

Flow diagram of CSV → normalized database transaction6 activities and 5 transitions: Start, Read customer CSV, Parse header and rows, Build parameterized operations, Commit customer batch, Return result.StartstartRead customer CSVfile.readParse header and rowscsv.parse1Build parameterizedoperationsdata.mapper2Commit customer batchsql.transaction3Return resultend
List the 6 activities and 5 transitions

Activities

  1. Start start
  2. Read customer CSV file.read
  3. Parse header and rows csv.parse
  4. Build parameterized operations data.mapper
  5. Commit customer batch sql.transaction
  6. Return result end

Transitions

  • Start → Read customer CSV (on success)
  • Read customer CSV → Parse header and rows (on success)
  • Parse header and rows → Build parameterized operations (on success)
  • Build parameterized operations → Commit customer batch (on success)
  • Commit customer batch → Return result (on success)

Walkthrough

  1. Read and parseThe File adapter receives the supplied CSV fixture; Parse CSV verifies the header and each row.
  2. Map named parametersNo raw SQL is taken from the input. Each row becomes a registered statement invocation.
  3. Commit as one unitSimulation returns the supplied transaction fixture. With approved live bindings the SQL adapter commits or rolls back all operations.

What you will practise

  • The File adapter receives the supplied CSV fixture; Parse CSV verifies the header and each row.
  • No raw SQL is taken from the input. Each row becomes a registered statement invocation.
  • Simulation returns the supplied transaction fixture. With approved live bindings the SQL adapter commits or rolls back all operations.

Sample cases

1 case with 4 assertions, run with python -m server.integration examples --all in simulation.

Two customer upserts (simulation)

Passed

Two customer upserts (simulation). This example uses supplied data only.

Expected result Two customer upserts (simulation); automatic checks verify the expected result.

4/4 assertions

  • Expected process status
  • Verify /committed
  • Verify /operations
  • Mapper executes

This sample run only; not a production certification.

Prerequisites

Runtime
Cohuno runtime 1.27.0, the version recorded when these cases last passed.
Starter
Manual start; no listener.
Optional dependencies
  • An approved SQLite database, or requirements-sql.txt for PostgreSQL needed only for live connections; simulation uses fixtures
Selected for this closure by the same rules as runtime packaging.
Simulation fixtures
  • db_demo sql · sql.transaction
  • files_demo file · file.read
Every sample run replaces these connections with the fixtures defined in its case. A live run needs an operator to configure an authorized connection for each.
Verification details

Provenance

What was verified, and when. The content part changes whenever the pack, a process in its closure, the runtime version or a case result changes; the gallery check then fails until the gallery is regenerated and the changed templates are verified again.

Verified content

Pack SHA-256
364a92fc15d31063067620eaa195a8b56466c45583ccfb8755be139d29d12a03
Closure SHA-256
c211f6269ff1b99b8825e6d5e481d10ec554f1048600adde99d57164173e4102
Runtime
1.27.0
Results
1/1 cases, 4/4 assertions, mode simulate, external calls: none.
Files in the closure
  • server/integration/example_packs/csv_database_lab.json
  • server/integration/templates/csv_database_lab.json

Verification event

Commit
f4ce7d08eedc90267b405ed1974344153a8b3a34
Verified at (UTC)
2026-10-31T21:19:21Z

How the Cohuno team reproduces this check

PYTHONPATH=. python -m server.integration examples --example csv_database_lab
PYTHONPATH=. python scripts/export_public_gallery.py --check