| 1 | # SQL Contract Definition |
| 2 | |
| 3 | Provides SQL persistence for contract definitions. |
| 4 | |
| 5 | ## Prerequisites |
| 6 | |
| 7 | Please apply this [schema](docs/schema.sql) to your SQL database. |
| 8 | |
| 9 | ## Entity Diagram |
| 10 | |
| 11 |  |
| 12 | |
| 13 | ## Configuration |
| 14 | |
| 15 | | Key | Description | Mandatory | |
| 16 | |:---------------------------------------|:----------------------------------|-----------| |
| 17 | | edc.datasource.contractdefinition.name | Datasource used by this extension | X | |
| 18 | |
| 19 | ## Create a flexible query API to accommodate `QuerySpec` |
| 20 | |
| 21 | _For the first version, only the `limit` and `offset` arguments from the `QuerySpec` will be used._ |
| 22 | |
| 23 | For subsequent versions it is recommended to re-use the `Clause` interface and its implementors, that were originally |
| 24 | implemented for CosmosDB, and create an equivalent set of clauses for SQL. Thus, there would be a `Limit-`, `Offset-` |
| 25 | , `Order-` and `WhereClause` for SQL. |
| 26 | |
| 27 | That way, dialect-dependent variants can be implemented should the need arise, because the actual SQL statement is |
| 28 | encoded in those clauses, offering a fluent Java API. |