Example plan
fixture.yaml
New here? Get started. See Running the examplesfor this plan's fixture, runtime, database or browser requirements. The exec example needs no fixture; Postgres and Playwright need their optional dependencies.
Seed reference data no API creates, then read it back. An exec step runs the migration that creates a countries table in catalog.db beside the plan (./bin/migrate-catalog needs Python 3), a fixture step inserts two rows through a connection declared writes: true, written so a second run changes nothing, and a sql step reads them back through a read-only connection. No fixture server is needed: run bin/vero run examples/fixture.yaml from the repository root.
apiVersion: vero.plan/v1
kind: Plan
metadata: { name: seed-countries }
lifecycle: { strategy: isolated }
connections:
catalog: { driver: sqlite, dsn: catalog.db }
catalog-admin: { driver: sqlite, dsn: catalog.db, writes: true }
tasks:
- name: migrate
steps:
- exec:
command: ["./bin/migrate-catalog", "catalog.db"]
workdir: "."
timeout: 30s
assert: [exitCode == 0, stdout contains "countries"]
- name: seed-countries
needs: [migrate]
steps:
- fixture:
connection: catalog-admin
statement: >
insert into countries (code, name) values ($1, $2), ($3, $4)
on conflict (code) do nothing
args: [PT, Portugal, ES, Spain]
assert: [rowsAffected <= 2]
results: { seeded: rowsAffected }
- name: countries-are-there
needs: [seed-countries]
steps:
- sql:
connection: catalog
query: select code, name from countries order by code
assert:
- rows count 2
- rows[0].code == "ES"
- rows[1].name == "Portugal"This page is examples/fixture.yaml in the repository.