Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
simonharrer committed Mar 21, 2024
1 parent 52d1313 commit d62f484
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,45 @@ Available import options:
$ datacontract test --publish https://api.datamesh-manager.com/api/runs
```

### Contract-First

1. Start with a `datacontract.yaml` template.
```bash
$ datacontract init
```

2. Add examples to the `datacontract.yaml`. Do not start with the data model, although you are probably tempted to do that. Examples are the fastest way to get feedback from everybody and not loose someone in the discussion.

3. Create the model based on the examples. Test the model against the examples to double check whether the model matches the examples.
```bash
$ datacontract test --examples
```

4. Add quality checks and additional type constraints one by one to the contract and make sure the examples and the actual data still adheres to the contract. Check against examples for a very fast feedback loop.
```bash
$ datacontract test --examples
```

5. Fill in the terms, descriptions, etc. Make sure you follow all best practices for a `datacontract.yaml` using the linter.
```bash
$ datacontract lint
```

6. Set up a CI pipeline that lints and tests the examples so you make sure that any changes later do not decrease the quality of the contract.
```bash
$ datacontract lint
$ datacontract test --examples
```

7. Use the export function to start building the providing data product as well as the integration into the consuming data products.
```bash
# data provider
$ datacontract export --format dbt
# data consumer
$ datacontract export --format dbt-sources
$ datacontract export --format dbt-staging-sql
```

### Schema Evolution

#### Non-breaking Changes
Expand Down

0 comments on commit d62f484

Please sign in to comment.