# CSV Import

This document defines CSV import behavior for master data.

## Source Form

A CSV source entry appears inside a master's source section. Its surface form is the source entry form defined in [schema.md](schema.md):

```mst
master Items {
  record { primary id: int, name: string }

  source {
    csv "data/items.csv"
    csv "data/items.en.csv" {
      separator: ",",
    }
  }
}
```

The source-kind identifier is `csv`. The string literal that follows names the CSV file. Path resolution is defined in [../tooling/configuration.md](../tooling/configuration.md).

## Options

The option clause is optional. The defined keys are:

- `separator` — `string`. The single-character field separator. Default: `","`.

Validation rules:

- An option name not listed above is reported as `masterbelt.checker.master_source_option_unknown`.
- An option value whose type does not match the declared type above is reported as `masterbelt.checker.master_source_option_type_mismatch`.

The full set of option keys and the per-importer parsing rules will be extended by future updates to this specification before adding new behavior.
