> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqlbuild.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> MODEL() header fields and SQL-validation controls.

## Common fields

| Field            | Description                                                                               |
| ---------------- | ----------------------------------------------------------------------------------------- |
| `materialized`   | `view`, `table`, `incremental`, `snapshot`, or a custom materialization name              |
| `tags`           | Tags used by selectors                                                                    |
| `description`    | Human-readable model description                                                          |
| `columns`        | Model-local column declarations or inherited-column audit augmentation                    |
| `model_schema`   | Reusable column schema name                                                               |
| `audits`         | Model-level audit instances                                                               |
| `enums`          | Model-local enum declarations; names must begin with `_`                                  |
| `constants`      | Model-local scalar constants; names must begin with `_`                                   |
| `schema`         | Destination warehouse schema override                                                     |
| `database`       | Destination database override                                                             |
| `alias`          | Destination relation-name override                                                        |
| `pre_hooks`      | SQL or Python hooks before materialization                                                |
| `post_hooks`     | SQL or Python hooks after materialization                                                 |
| `enabled`        | Set to `false` to disable the model                                                       |
| `contract`       | `none` for an open statically checked declaration, or `enforced` for an exact declaration |
| `sql_validation` | Per-model SQL-validation override                                                         |

## SQL validation

SQL validation has two hard gates and one effective setting:

1. `settings.sql_analysis` must be enabled.
2. `--no-sql-validation` must not be present.
3. `MODEL (sql_validation true|false)` overrides `settings.sql_validation` for that model. If omitted, the project setting is used.

The model override can re-enable validation when the project-level `settings.sql_validation` value is false, but it cannot bypass disabled SQL analysis or the CLI kill switch.

## Table fields

| Field                   | Description                                                                                                                                                                                                                             |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `run_despite_unchanged` | Table-only change-aware policy. `always` rebuilds whenever selected. A duration such as `30d`, `12h`, or `90m` rebuilds while the newest timestamp-based upstream source observation is within that age; it is not a periodic schedule. |

Table promotion mode is a project setting rather than a `MODEL()` field. Staged promotion is the default. Direct promotion is incompatible with model type enforcement and exact contracts; see [Materializations](/concepts/models/materializations#table).

## Incremental fields

| Field                     | Description                                                                                                 |
| ------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `incremental_strategy`    | `append`, `delete_insert`, or `merge`                                                                       |
| `cursor`                  | Output column used to track incremental position                                                            |
| `cursor_type`             | `timestamp` or `integer`                                                                                    |
| `cursor_grain`            | Timestamp grain such as `second`, `hour`, or `day`                                                          |
| `cursor_start`            | Lower cursor bound                                                                                          |
| `cursor_inputs`           | Upstream names mapped to cursor columns                                                                     |
| `unique_key`              | Merge or delete/insert matching columns                                                                     |
| `incremental_mode`        | Set to `microbatch` for batched execution                                                                   |
| `batch_size`              | Timestamp duration string such as `1d` or `1h`; use a numeric string such as `"1000"` for an integer cursor |
| `lookback`                | Backward replay extension                                                                                   |
| `append_cursor_inclusive` | Include (`true`, default) or exclude (`false`) the current append-cursor boundary                           |
| `merge_exclude_columns`   | Columns left unchanged by matched-row merge updates                                                         |
| `allow_full_refresh`      | Allow or deny explicit full refresh for this incremental model                                              |
| `on_schema_change`        | `append_new_columns`, `sync_all_columns`, `ignore`, or `fail`                                               |
| `replay_on_change`        | `forward`, `full`, or `bounded-<duration>`                                                                  |

See [Incremental](/concepts/incremental) for full semantics.

Current compatibility behavior treats an unrecognized `on_schema_change` value as the default `append_new_columns` policy and an unrecognized `replay_on_change` value as `forward`. Use the documented values exactly; future validation may reject unknown values instead of applying these fallbacks.

## Snapshot fields

| Field                     | Description                                           |
| ------------------------- | ----------------------------------------------------- |
| `unique_key`              | Columns identifying one logical record                |
| `snapshot_strategy`       | `timestamp` or `check`                                |
| `updated_at`              | Source update timestamp for the timestamp strategy    |
| `check_columns`           | Columns compared by the check strategy, or `[*]`      |
| `observed_at`             | Observation timestamp for historical inputs           |
| `historical_input`        | `snapshot` or `changes`                               |
| `initial_valid_from`      | Initial validity policy for first-seen rows           |
| `invalidate_hard_deletes` | Close records that disappear from current-state input |
| `valid_from_column`       | Override the generated valid-from column name         |
| `valid_to_column`         | Override the generated valid-to column name           |
| `snapshot_full_refresh`   | Snapshot full-refresh safety policy                   |
| `snapshot_schema_change`  | Snapshot schema-change policy                         |

See [Snapshots](/concepts/snapshots) for strategy combinations, defaults, and safety behavior.

## Custom materialization fields

| Field          | Description                                  |
| -------------- | -------------------------------------------- |
| `config`       | Arbitrary values passed to `ctx.config`      |
| `placeholders` | Defaults for runtime `@@@placeholder` tokens |

## Diff fields

| Field                      | Description                                |
| -------------------------- | ------------------------------------------ |
| `row_diff_exclude_columns` | Columns excluded from row-level comparison |
| `row_diff_tolerances`      | Numeric comparison tolerances              |
