feat: expose unique columns and many-to-many markers in OpenAPI
Add unique constraint and many-to-many relationship metadata to the generated OpenAPI spec so clients can render them. - Store unique constraints on Table as tableUniqueCols (mirroring tablePKCols) instead of denormalizing them onto each Column. - Compute unique constraints via a per-table tbl_unique_cols CTE in tablesSqlQuery. - Annotate unique columns and composite unique constraints in property descriptions, and emit m2m markers in table descriptions.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
tableName: authors_only
|
||||
tablePKCols: []
|
||||
tableSchema: public
|
||||
tableUniqueCols: []
|
||||
tableUpdatable: true
|
||||
|
||||
- - qiName: cats
|
||||
@@ -39,6 +40,7 @@
|
||||
tablePKCols:
|
||||
- id
|
||||
tableSchema: public
|
||||
tableUniqueCols: []
|
||||
tableUpdatable: true
|
||||
|
||||
- - qiName: items_w_isolation_level
|
||||
@@ -69,6 +71,7 @@
|
||||
tableName: items_w_isolation_level
|
||||
tablePKCols: []
|
||||
tableSchema: public
|
||||
tableUniqueCols: []
|
||||
tableUpdatable: true
|
||||
|
||||
- - qiName: directors
|
||||
@@ -100,6 +103,7 @@
|
||||
tablePKCols:
|
||||
- id
|
||||
tableSchema: public
|
||||
tableUniqueCols: []
|
||||
tableUpdatable: true
|
||||
|
||||
- - qiName: projects
|
||||
@@ -112,6 +116,7 @@
|
||||
tableName: projects
|
||||
tablePKCols: []
|
||||
tableSchema: public
|
||||
tableUniqueCols: []
|
||||
tableUpdatable: true
|
||||
|
||||
- - qiName: infinite_recursion
|
||||
@@ -124,6 +129,7 @@
|
||||
tableName: infinite_recursion
|
||||
tablePKCols: []
|
||||
tableSchema: public
|
||||
tableUniqueCols: []
|
||||
tableUpdatable: false
|
||||
|
||||
- - qiName: awards
|
||||
@@ -182,6 +188,7 @@
|
||||
tablePKCols:
|
||||
- id
|
||||
tableSchema: public
|
||||
tableUniqueCols: []
|
||||
tableUpdatable: true
|
||||
|
||||
- - qiName: films
|
||||
@@ -222,6 +229,7 @@
|
||||
tablePKCols:
|
||||
- id
|
||||
tableSchema: public
|
||||
tableUniqueCols: []
|
||||
tableUpdatable: true
|
||||
|
||||
- - qiName: items
|
||||
@@ -243,4 +251,5 @@
|
||||
tableName: items
|
||||
tablePKCols: []
|
||||
tableSchema: public
|
||||
tableUniqueCols: []
|
||||
tableUpdatable: true
|
||||
|
||||
Reference in New Issue
Block a user