Guides
Project workflow
This guide is for readers with an existing Daana project who need to select the project and target database for daana check, daana install, daana deploy and daana execute. The example is not the tutorial's project. It was created with daana init bookstore, which names its profile dev; the tutorial's --example bookstore project has the profile duckdb.
The bookstore model and its two starter mappings have been written, and the dev profile points to a local DuckDB file. Locate daana.yaml, connections.yaml and config.yaml in the project tree:
bookstore/
├── daana.yaml # project declaration: enabled domains, workflow, target profile
├── connections.yaml # connection profiles (the dev profile)
├── config.yaml # CLI preferences
├── bookstore.duckdb # source tables in stage, the warehouse in daana_dw
├── dab/
│ ├── model.yaml # customer, order and is_placed_by
│ ├── workflow.yaml # BOOK_RETAILER_WORKFLOW; paths relative to this file
│ └── mappings/
│ ├── customer-mapping.yaml
│ └── order-mapping.yaml
├── das/contracts/ # reserved for source contracts
└── dar/ # reserved; DAR generation stays explicit
The root commands daana check, daana install, daana deploy and daana execute read the project declaration in daana.yaml. config.yaml holds the CLI preferences. The connection profiles file holds credentials and references to environment variables.
daana init writes a profile named dev and selects it. Inspect the selected profile and the path to the connection profiles file in daana.yaml:
version: 1
domains:
dab:
workflow: dab/workflow.yaml
connections:
file: connections.yaml
profile: dev
The declaration selects the dev profile in connections.yaml. Inspect its database path and target schemas:
# connections.yaml: the dev profile, a local DuckDB file, pointed at bookstore.duckdb
connections:
dev:
type: duckdb
database: bookstore.duckdb
target_schema: daana_dw
stage_schema: daana_stage
metadata_schema: daana_metadata
A relative DuckDB path resolves from the directory of the connections file. Here, bookstore.duckdb is beside connections.yaml, whichever directory the command runs from.
Paths in daana.yaml belong to its directory. By default, Daana looks for daana.yaml only in the directory the command runs from. Use --project to select another declaration and --format json to request JSON output:
daana check
daana check --project /path/to/daana.yaml --format json
The check admits the actual selected profile and runs existing authored workflow, model and mapping validation offline. It does not connect to the target database or probe source schemas. A nonempty workflow connection must match the selected profile; an empty workflow connection inherits that operational target.
Text and JSON distinguish selected-profile admission from workflow validation and unrequested source-schema coverage. Exit codes are 0 for success, 1 for authored validation findings, 2 for configuration refusal and 3 for direct declaration/profile I/O or report-output failure. Nested workflow diagnostics keep their existing validation behavior.
daana init puts the DAB files of a new project in dab/, reserves das/contracts/ and dar/ with guidance, and enables only DAB. A project that already has its files in a flat layout keeps those file paths. The bookstore tutorial project uses the same dab/ layout.
The generated workflow needs completed mappings before daana check can pass. In this project, dab/workflow.yaml lists the two starter mappings, and the workflow and its mappings name the dev connection.
The reserved directories do not mean that Daana validates DAS, creates a reporting workspace or runs Dataform automatically. Omit DAR until the DAR documents are written. dar: {spec: dar/} enables their offline schema, graph and backing checks, using the model named by the selected DAB workflow. The model path is relative to that workflow. DAS and dar: true, set in place of dar: {spec: dar/}, still refuse project checks.
Root check is offline, so it passes even when a mapping names a column that the source table does not have. To test mappings against the source tables, use the connected checks in Check DAB configurations.
When daana check passes, daana install, daana deploy and daana execute use the target database that daana.yaml selects. The --dry-run flag shows what daana execute would do without executing it. Install and deploy to the selected target database, then preview execution:
daana install
daana deploy
daana execute --dry-run
Install validates only the target configuration and does not require completed model/mapping files. A project deploy always runs required authored checks; --skip-validation suppresses only its optional source check. The daana execute command checks the project's files as written, then uses the deployed workflow's identity and follows the existing consent rules. Local edits do not redeploy or replace deployed SQL.
Explicit workflow and connection flags may confirm the selection. Conflicting flags and direct --db-* overrides are refused; ambient DB defaults cannot redirect the selected project. Explicit --project on an unwired command is refused. Public dar check, dar lint and explicit dar generate also accept --project; without that flag, manual nearby-model lookup stays independent. An existing unreadable declaration refuses operations; only a truly absent ambient declaration retains legacy lifecycle discovery.
Explicit DAR project generation
The --project flag selects the project for DAR commands from another directory. --preview generates a local preview from the DAB model as written, without connecting, and --out names the directory it is written to. Check and lint the DAR documents of the project in /work/shop/daana.yaml, then generate a preview in /tmp/shop-dar-preview:
daana dar check --project /work/shop/daana.yaml --format json
daana dar lint --project /work/shop/daana.yaml --format json
daana dar generate --project /work/shop/daana.yaml --preview --out /tmp/shop-dar-preview --format json
The selected project supplies the input and the DAB model as written in the project, but it does not select a catalog mode. Choose preview, captured manifest or explicit target database connection flags. Newly authored attributes are available to preview; live generation still uses the actual deployed a0 catalog and does not invent undeployed fields. Root lifecycle checks enabled DAR offline before the existing DAB operation. Workspace targets and constants remain beside DAR input; profiles keep credentials. The default project output belongs to its declaration root at definitions/dar; explicit and configured output paths retain normal CLI semantics.