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