simetra 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +40 -2
- package/dist/compiler/index.d.ts +2532 -0
- package/dist/compiler/index.js +38373 -0
- package/dist/model/index.d.ts +5784 -0
- package/dist/model/index.js +4818 -0
- package/dist/schema/index.d.ts +3073 -0
- package/dist/schema/index.js +12210 -0
- package/dist/server/index.d.ts +103 -0
- package/dist/server/index.js +1503 -0
- package/package.json +81 -3
- package/schemas/accumulation-registers.schema.json +996 -0
- package/schemas/catalogs.schema.json +1278 -0
- package/schemas/constants.schema.json +327 -0
- package/schemas/custom-tables.schema.json +860 -0
- package/schemas/documents.schema.json +1285 -0
- package/schemas/enumerations.schema.json +121 -0
- package/schemas/event-subscriptions.schema.json +165 -0
- package/schemas/information-registers.schema.json +1202 -0
- package/schemas/pg-enums.schema.json +81 -0
- package/schemas/project.schema.json +945 -0
- package/schemas/rights-sets.schema.json +248 -0
- package/schemas/roles.schema.json +498 -0
- package/schemas/sql-debt.schema.json +23 -0
|
@@ -0,0 +1,860 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"$schema": {
|
|
6
|
+
"description": "Editor hint: path to the JSON Schema of this file.",
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
9
|
+
"id": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"format": "uuid",
|
|
12
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
|
|
13
|
+
"description": "Stable lowercase UUID v4 identity of the element. Assigned by tooling at creation and never reused; a rename keeps it."
|
|
14
|
+
},
|
|
15
|
+
"name": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
18
|
+
"description": "Logical object name in PascalCase."
|
|
19
|
+
},
|
|
20
|
+
"physicalName": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"description": "Physical database name. Assigned once at creation and never changed, so a rename emits no DDL. At most 63 bytes in UTF-8."
|
|
24
|
+
},
|
|
25
|
+
"schema": {
|
|
26
|
+
"description": "PostgreSQL schema of the object; the project defaultSchema applies when absent.",
|
|
27
|
+
"type": "string"
|
|
28
|
+
},
|
|
29
|
+
"scope": {
|
|
30
|
+
"description": "Scope kind of the object, or none to keep it outside any scope. Required when the project declares scope kinds.",
|
|
31
|
+
"type": "string"
|
|
32
|
+
},
|
|
33
|
+
"title": {
|
|
34
|
+
"description": "Human-readable title of the object.",
|
|
35
|
+
"type": "object",
|
|
36
|
+
"properties": {
|
|
37
|
+
"uk": {
|
|
38
|
+
"description": "Ukrainian text.",
|
|
39
|
+
"type": "string"
|
|
40
|
+
},
|
|
41
|
+
"en": {
|
|
42
|
+
"description": "English text.",
|
|
43
|
+
"type": "string"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"additionalProperties": false
|
|
47
|
+
},
|
|
48
|
+
"description": {
|
|
49
|
+
"description": "Description of the object.",
|
|
50
|
+
"type": "object",
|
|
51
|
+
"properties": {
|
|
52
|
+
"uk": {
|
|
53
|
+
"description": "Ukrainian text.",
|
|
54
|
+
"type": "string"
|
|
55
|
+
},
|
|
56
|
+
"en": {
|
|
57
|
+
"description": "English text.",
|
|
58
|
+
"type": "string"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"additionalProperties": false
|
|
62
|
+
},
|
|
63
|
+
"kind": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"const": "CustomTable",
|
|
66
|
+
"description": "Metadata kind; always CustomTable."
|
|
67
|
+
},
|
|
68
|
+
"kindLabel": {
|
|
69
|
+
"description": "Physical kind label of the object. Assigned once at creation and never changed, so a rename keeps it.",
|
|
70
|
+
"type": "string",
|
|
71
|
+
"minLength": 1
|
|
72
|
+
},
|
|
73
|
+
"comment": {
|
|
74
|
+
"description": "Comment on the table.",
|
|
75
|
+
"type": "string"
|
|
76
|
+
},
|
|
77
|
+
"columns": {
|
|
78
|
+
"minItems": 1,
|
|
79
|
+
"type": "array",
|
|
80
|
+
"items": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"properties": {
|
|
83
|
+
"id": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"format": "uuid",
|
|
86
|
+
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$",
|
|
87
|
+
"description": "Stable lowercase UUID v4 identity of the element. Assigned by tooling at creation and never reused; a rename keeps it."
|
|
88
|
+
},
|
|
89
|
+
"name": {
|
|
90
|
+
"type": "string",
|
|
91
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
|
|
92
|
+
"description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
|
|
93
|
+
},
|
|
94
|
+
"physicalName": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"minLength": 1,
|
|
97
|
+
"description": "Physical database name. Assigned once at creation and never changed, so a rename emits no DDL. At most 63 bytes in UTF-8."
|
|
98
|
+
},
|
|
99
|
+
"title": {
|
|
100
|
+
"description": "Human-readable title of the column.",
|
|
101
|
+
"type": "object",
|
|
102
|
+
"properties": {
|
|
103
|
+
"uk": {
|
|
104
|
+
"description": "Ukrainian text.",
|
|
105
|
+
"type": "string"
|
|
106
|
+
},
|
|
107
|
+
"en": {
|
|
108
|
+
"description": "English text.",
|
|
109
|
+
"type": "string"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"additionalProperties": false
|
|
113
|
+
},
|
|
114
|
+
"notNull": {
|
|
115
|
+
"default": false,
|
|
116
|
+
"description": "Whether the column is NOT NULL.",
|
|
117
|
+
"type": "boolean"
|
|
118
|
+
},
|
|
119
|
+
"default": {
|
|
120
|
+
"description": "SQL expression used as the column default.",
|
|
121
|
+
"type": "string"
|
|
122
|
+
},
|
|
123
|
+
"identity": {
|
|
124
|
+
"description": "Identity generation mode; requires SmallInt, Integer or BigInt type.",
|
|
125
|
+
"type": "string",
|
|
126
|
+
"enum": [
|
|
127
|
+
"always",
|
|
128
|
+
"byDefault"
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
"generated": {
|
|
132
|
+
"description": "Stored generated column; incompatible with default and identity.",
|
|
133
|
+
"type": "object",
|
|
134
|
+
"properties": {
|
|
135
|
+
"expression": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"minLength": 1,
|
|
138
|
+
"description": "SQL expression of the stored generated column."
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"required": [
|
|
142
|
+
"expression"
|
|
143
|
+
],
|
|
144
|
+
"additionalProperties": false
|
|
145
|
+
},
|
|
146
|
+
"collation": {
|
|
147
|
+
"description": "Collation of the column (pg_collation); absent means the type default.",
|
|
148
|
+
"type": "object",
|
|
149
|
+
"properties": {
|
|
150
|
+
"schema": {
|
|
151
|
+
"description": "Schema of the object, unquoted; omitted for objects in pg_catalog.",
|
|
152
|
+
"type": "string",
|
|
153
|
+
"minLength": 1
|
|
154
|
+
},
|
|
155
|
+
"name": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"minLength": 1,
|
|
158
|
+
"description": "Name of the object, unquoted, as Postgres reports it."
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"required": [
|
|
162
|
+
"name"
|
|
163
|
+
],
|
|
164
|
+
"additionalProperties": false
|
|
165
|
+
},
|
|
166
|
+
"comment": {
|
|
167
|
+
"description": "Comment on the column.",
|
|
168
|
+
"type": "string"
|
|
169
|
+
},
|
|
170
|
+
"type": {
|
|
171
|
+
"type": "string",
|
|
172
|
+
"enum": [
|
|
173
|
+
"UUID",
|
|
174
|
+
"String",
|
|
175
|
+
"Text",
|
|
176
|
+
"Integer",
|
|
177
|
+
"SmallInt",
|
|
178
|
+
"BigInt",
|
|
179
|
+
"Numeric",
|
|
180
|
+
"Boolean",
|
|
181
|
+
"Date",
|
|
182
|
+
"DateTime",
|
|
183
|
+
"Bytes",
|
|
184
|
+
"Json",
|
|
185
|
+
"Ref",
|
|
186
|
+
"PgEnum",
|
|
187
|
+
"Raw"
|
|
188
|
+
],
|
|
189
|
+
"description": "Logical type, PgEnum for an accepted enum, or Raw for a raw PostgreSQL type."
|
|
190
|
+
},
|
|
191
|
+
"length": {
|
|
192
|
+
"description": "Maximum length; required for String and allowed only there.",
|
|
193
|
+
"type": "integer",
|
|
194
|
+
"exclusiveMinimum": 0,
|
|
195
|
+
"maximum": 9007199254740991
|
|
196
|
+
},
|
|
197
|
+
"precision": {
|
|
198
|
+
"description": "Total number of digits; allowed only for Numeric.",
|
|
199
|
+
"type": "integer",
|
|
200
|
+
"exclusiveMinimum": 0,
|
|
201
|
+
"maximum": 9007199254740991
|
|
202
|
+
},
|
|
203
|
+
"scale": {
|
|
204
|
+
"description": "Digits after the decimal point; requires precision.",
|
|
205
|
+
"type": "integer",
|
|
206
|
+
"minimum": 0,
|
|
207
|
+
"maximum": 9007199254740991
|
|
208
|
+
},
|
|
209
|
+
"ref": {
|
|
210
|
+
"description": "Single reference target of a Ref value; mutually exclusive with allowedTypes.",
|
|
211
|
+
"type": "object",
|
|
212
|
+
"properties": {
|
|
213
|
+
"kind": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"enum": [
|
|
216
|
+
"Catalog",
|
|
217
|
+
"Document",
|
|
218
|
+
"Enumeration",
|
|
219
|
+
"InformationRegister",
|
|
220
|
+
"AccumulationRegister",
|
|
221
|
+
"Constant",
|
|
222
|
+
"CustomTable",
|
|
223
|
+
"PgEnum",
|
|
224
|
+
"EventSubscription",
|
|
225
|
+
"RightsSet",
|
|
226
|
+
"Role"
|
|
227
|
+
],
|
|
228
|
+
"description": "Kind of the referenced metadata object."
|
|
229
|
+
},
|
|
230
|
+
"name": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
233
|
+
"description": "Logical name of the referenced object."
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"required": [
|
|
237
|
+
"kind",
|
|
238
|
+
"name"
|
|
239
|
+
],
|
|
240
|
+
"additionalProperties": false
|
|
241
|
+
},
|
|
242
|
+
"allowedTypes": {
|
|
243
|
+
"description": "Polymorphic reference targets of a Ref value; mutually exclusive with ref.",
|
|
244
|
+
"minItems": 1,
|
|
245
|
+
"type": "array",
|
|
246
|
+
"items": {
|
|
247
|
+
"type": "object",
|
|
248
|
+
"properties": {
|
|
249
|
+
"kind": {
|
|
250
|
+
"type": "string",
|
|
251
|
+
"enum": [
|
|
252
|
+
"Catalog",
|
|
253
|
+
"Document",
|
|
254
|
+
"Enumeration",
|
|
255
|
+
"InformationRegister",
|
|
256
|
+
"AccumulationRegister",
|
|
257
|
+
"Constant",
|
|
258
|
+
"CustomTable",
|
|
259
|
+
"PgEnum",
|
|
260
|
+
"EventSubscription",
|
|
261
|
+
"RightsSet",
|
|
262
|
+
"Role"
|
|
263
|
+
],
|
|
264
|
+
"description": "Kind of the referenced metadata object."
|
|
265
|
+
},
|
|
266
|
+
"name": {
|
|
267
|
+
"type": "string",
|
|
268
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
269
|
+
"description": "Logical name of the referenced object."
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
"required": [
|
|
273
|
+
"kind",
|
|
274
|
+
"name"
|
|
275
|
+
],
|
|
276
|
+
"additionalProperties": false,
|
|
277
|
+
"description": "Reference to a metadata object by kind and logical name; the compiler resolves it to an id."
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
"array": {
|
|
281
|
+
"description": "Whether the value is an array of the type.",
|
|
282
|
+
"type": "boolean"
|
|
283
|
+
},
|
|
284
|
+
"enum": {
|
|
285
|
+
"description": "Enum type of a PgEnum column.",
|
|
286
|
+
"type": "object",
|
|
287
|
+
"properties": {
|
|
288
|
+
"kind": {
|
|
289
|
+
"type": "string",
|
|
290
|
+
"const": "PgEnum",
|
|
291
|
+
"description": "Always PgEnum."
|
|
292
|
+
},
|
|
293
|
+
"name": {
|
|
294
|
+
"type": "string",
|
|
295
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
296
|
+
"description": "Logical name of the PgEnum object."
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
"required": [
|
|
300
|
+
"kind",
|
|
301
|
+
"name"
|
|
302
|
+
],
|
|
303
|
+
"additionalProperties": false
|
|
304
|
+
},
|
|
305
|
+
"pgType": {
|
|
306
|
+
"description": "Raw PostgreSQL type of a Raw column.",
|
|
307
|
+
"type": "string",
|
|
308
|
+
"minLength": 1
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
"required": [
|
|
312
|
+
"name",
|
|
313
|
+
"type"
|
|
314
|
+
],
|
|
315
|
+
"additionalProperties": false
|
|
316
|
+
},
|
|
317
|
+
"description": "Columns of the table."
|
|
318
|
+
},
|
|
319
|
+
"primaryKey": {
|
|
320
|
+
"description": "Primary key of the table.",
|
|
321
|
+
"type": "object",
|
|
322
|
+
"properties": {
|
|
323
|
+
"name": {
|
|
324
|
+
"description": "Constraint name; when absent the PostgreSQL default name is used.",
|
|
325
|
+
"type": "string",
|
|
326
|
+
"minLength": 1
|
|
327
|
+
},
|
|
328
|
+
"columns": {
|
|
329
|
+
"minItems": 1,
|
|
330
|
+
"type": "array",
|
|
331
|
+
"items": {
|
|
332
|
+
"type": "string",
|
|
333
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
|
|
334
|
+
"description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
|
|
335
|
+
},
|
|
336
|
+
"description": "Logical names of columns of this table."
|
|
337
|
+
},
|
|
338
|
+
"deferrable": {
|
|
339
|
+
"default": "no",
|
|
340
|
+
"description": "Whether the constraint check can be deferred.",
|
|
341
|
+
"type": "string",
|
|
342
|
+
"enum": [
|
|
343
|
+
"no",
|
|
344
|
+
"deferrable",
|
|
345
|
+
"initiallyDeferred"
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
"required": [
|
|
350
|
+
"columns"
|
|
351
|
+
],
|
|
352
|
+
"additionalProperties": false
|
|
353
|
+
},
|
|
354
|
+
"uniques": {
|
|
355
|
+
"default": [],
|
|
356
|
+
"description": "Unique constraints of the table.",
|
|
357
|
+
"type": "array",
|
|
358
|
+
"items": {
|
|
359
|
+
"type": "object",
|
|
360
|
+
"properties": {
|
|
361
|
+
"name": {
|
|
362
|
+
"description": "Constraint name; when absent the PostgreSQL default name is used.",
|
|
363
|
+
"type": "string",
|
|
364
|
+
"minLength": 1
|
|
365
|
+
},
|
|
366
|
+
"columns": {
|
|
367
|
+
"minItems": 1,
|
|
368
|
+
"type": "array",
|
|
369
|
+
"items": {
|
|
370
|
+
"type": "string",
|
|
371
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
|
|
372
|
+
"description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
|
|
373
|
+
},
|
|
374
|
+
"description": "Logical names of columns of this table."
|
|
375
|
+
},
|
|
376
|
+
"nullsNotDistinct": {
|
|
377
|
+
"default": false,
|
|
378
|
+
"description": "Whether NULLs are treated as equal.",
|
|
379
|
+
"type": "boolean"
|
|
380
|
+
},
|
|
381
|
+
"deferrable": {
|
|
382
|
+
"default": "no",
|
|
383
|
+
"description": "Whether the constraint check can be deferred.",
|
|
384
|
+
"type": "string",
|
|
385
|
+
"enum": [
|
|
386
|
+
"no",
|
|
387
|
+
"deferrable",
|
|
388
|
+
"initiallyDeferred"
|
|
389
|
+
]
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
"required": [
|
|
393
|
+
"columns"
|
|
394
|
+
],
|
|
395
|
+
"additionalProperties": false,
|
|
396
|
+
"description": "Unique constraint."
|
|
397
|
+
}
|
|
398
|
+
},
|
|
399
|
+
"checks": {
|
|
400
|
+
"default": [],
|
|
401
|
+
"description": "Check constraints of the table.",
|
|
402
|
+
"type": "array",
|
|
403
|
+
"items": {
|
|
404
|
+
"type": "object",
|
|
405
|
+
"properties": {
|
|
406
|
+
"name": {
|
|
407
|
+
"description": "Constraint name; when absent the PostgreSQL default name is used.",
|
|
408
|
+
"type": "string",
|
|
409
|
+
"minLength": 1
|
|
410
|
+
},
|
|
411
|
+
"expression": {
|
|
412
|
+
"type": "string",
|
|
413
|
+
"minLength": 1,
|
|
414
|
+
"description": "SQL boolean expression of the check."
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
"required": [
|
|
418
|
+
"expression"
|
|
419
|
+
],
|
|
420
|
+
"additionalProperties": false,
|
|
421
|
+
"description": "Check constraint."
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
"foreignKeys": {
|
|
425
|
+
"default": [],
|
|
426
|
+
"description": "Foreign keys of the table.",
|
|
427
|
+
"type": "array",
|
|
428
|
+
"items": {
|
|
429
|
+
"type": "object",
|
|
430
|
+
"properties": {
|
|
431
|
+
"name": {
|
|
432
|
+
"description": "Constraint name; when absent the PostgreSQL default name is used.",
|
|
433
|
+
"type": "string",
|
|
434
|
+
"minLength": 1
|
|
435
|
+
},
|
|
436
|
+
"columns": {
|
|
437
|
+
"minItems": 1,
|
|
438
|
+
"type": "array",
|
|
439
|
+
"items": {
|
|
440
|
+
"type": "string",
|
|
441
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
|
|
442
|
+
"description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
|
|
443
|
+
},
|
|
444
|
+
"description": "Logical names of columns of this table."
|
|
445
|
+
},
|
|
446
|
+
"references": {
|
|
447
|
+
"anyOf": [
|
|
448
|
+
{
|
|
449
|
+
"type": "object",
|
|
450
|
+
"properties": {
|
|
451
|
+
"object": {
|
|
452
|
+
"type": "object",
|
|
453
|
+
"properties": {
|
|
454
|
+
"kind": {
|
|
455
|
+
"type": "string",
|
|
456
|
+
"enum": [
|
|
457
|
+
"Catalog",
|
|
458
|
+
"Document",
|
|
459
|
+
"Enumeration",
|
|
460
|
+
"InformationRegister",
|
|
461
|
+
"AccumulationRegister",
|
|
462
|
+
"Constant",
|
|
463
|
+
"CustomTable",
|
|
464
|
+
"PgEnum",
|
|
465
|
+
"EventSubscription",
|
|
466
|
+
"RightsSet",
|
|
467
|
+
"Role"
|
|
468
|
+
],
|
|
469
|
+
"description": "Kind of the referenced metadata object."
|
|
470
|
+
},
|
|
471
|
+
"name": {
|
|
472
|
+
"type": "string",
|
|
473
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
474
|
+
"description": "Logical name of the referenced object."
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
"required": [
|
|
478
|
+
"kind",
|
|
479
|
+
"name"
|
|
480
|
+
],
|
|
481
|
+
"additionalProperties": false,
|
|
482
|
+
"description": "Referenced metadata object."
|
|
483
|
+
},
|
|
484
|
+
"columns": {
|
|
485
|
+
"minItems": 1,
|
|
486
|
+
"type": "array",
|
|
487
|
+
"items": {
|
|
488
|
+
"type": "string",
|
|
489
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
|
|
490
|
+
"description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
|
|
491
|
+
},
|
|
492
|
+
"description": "Logical names of columns of the referenced CustomTable."
|
|
493
|
+
}
|
|
494
|
+
},
|
|
495
|
+
"required": [
|
|
496
|
+
"object",
|
|
497
|
+
"columns"
|
|
498
|
+
],
|
|
499
|
+
"additionalProperties": false
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"type": "object",
|
|
503
|
+
"properties": {
|
|
504
|
+
"object": {
|
|
505
|
+
"type": "object",
|
|
506
|
+
"properties": {
|
|
507
|
+
"kind": {
|
|
508
|
+
"type": "string",
|
|
509
|
+
"enum": [
|
|
510
|
+
"Catalog",
|
|
511
|
+
"Document",
|
|
512
|
+
"Enumeration",
|
|
513
|
+
"InformationRegister",
|
|
514
|
+
"AccumulationRegister",
|
|
515
|
+
"Constant",
|
|
516
|
+
"CustomTable",
|
|
517
|
+
"PgEnum",
|
|
518
|
+
"EventSubscription",
|
|
519
|
+
"RightsSet",
|
|
520
|
+
"Role"
|
|
521
|
+
],
|
|
522
|
+
"description": "Kind of the referenced metadata object."
|
|
523
|
+
},
|
|
524
|
+
"name": {
|
|
525
|
+
"type": "string",
|
|
526
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
527
|
+
"description": "Logical name of the referenced object."
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
"required": [
|
|
531
|
+
"kind",
|
|
532
|
+
"name"
|
|
533
|
+
],
|
|
534
|
+
"additionalProperties": false,
|
|
535
|
+
"description": "Referenced object of a kind (not a CustomTable)."
|
|
536
|
+
},
|
|
537
|
+
"key": {
|
|
538
|
+
"type": "string",
|
|
539
|
+
"enum": [
|
|
540
|
+
"ref",
|
|
541
|
+
"scopedRef"
|
|
542
|
+
],
|
|
543
|
+
"description": "Referenced key of the kind table: \"ref\" is its key column (one local column); \"scopedRef\" is the pair (scope column, key) of a table with its own scope column (two local columns: scope, then key)."
|
|
544
|
+
}
|
|
545
|
+
},
|
|
546
|
+
"required": [
|
|
547
|
+
"object",
|
|
548
|
+
"key"
|
|
549
|
+
],
|
|
550
|
+
"additionalProperties": false
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"type": "object",
|
|
554
|
+
"properties": {
|
|
555
|
+
"external": {
|
|
556
|
+
"type": "object",
|
|
557
|
+
"properties": {
|
|
558
|
+
"schema": {
|
|
559
|
+
"type": "string",
|
|
560
|
+
"minLength": 1,
|
|
561
|
+
"description": "PostgreSQL schema of the external table."
|
|
562
|
+
},
|
|
563
|
+
"table": {
|
|
564
|
+
"type": "string",
|
|
565
|
+
"minLength": 1,
|
|
566
|
+
"description": "Physical name of the external table."
|
|
567
|
+
},
|
|
568
|
+
"columns": {
|
|
569
|
+
"minItems": 1,
|
|
570
|
+
"type": "array",
|
|
571
|
+
"items": {
|
|
572
|
+
"type": "string",
|
|
573
|
+
"minLength": 1
|
|
574
|
+
},
|
|
575
|
+
"description": "Physical column names of the external table."
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
"required": [
|
|
579
|
+
"schema",
|
|
580
|
+
"table",
|
|
581
|
+
"columns"
|
|
582
|
+
],
|
|
583
|
+
"additionalProperties": false,
|
|
584
|
+
"description": "Referenced table outside the metadata."
|
|
585
|
+
}
|
|
586
|
+
},
|
|
587
|
+
"required": [
|
|
588
|
+
"external"
|
|
589
|
+
],
|
|
590
|
+
"additionalProperties": false
|
|
591
|
+
}
|
|
592
|
+
],
|
|
593
|
+
"description": "Referenced target: columns of a CustomTable, the key of a kind table, or an external table."
|
|
594
|
+
},
|
|
595
|
+
"onDelete": {
|
|
596
|
+
"default": "noAction",
|
|
597
|
+
"description": "Action on delete of the referenced row.",
|
|
598
|
+
"type": "string",
|
|
599
|
+
"enum": [
|
|
600
|
+
"noAction",
|
|
601
|
+
"restrict",
|
|
602
|
+
"cascade",
|
|
603
|
+
"setNull",
|
|
604
|
+
"setDefault"
|
|
605
|
+
]
|
|
606
|
+
},
|
|
607
|
+
"onUpdate": {
|
|
608
|
+
"default": "noAction",
|
|
609
|
+
"description": "Action on update of the referenced key.",
|
|
610
|
+
"type": "string",
|
|
611
|
+
"enum": [
|
|
612
|
+
"noAction",
|
|
613
|
+
"restrict",
|
|
614
|
+
"cascade",
|
|
615
|
+
"setNull",
|
|
616
|
+
"setDefault"
|
|
617
|
+
]
|
|
618
|
+
},
|
|
619
|
+
"deferrable": {
|
|
620
|
+
"default": "no",
|
|
621
|
+
"description": "Whether the constraint check can be deferred.",
|
|
622
|
+
"type": "string",
|
|
623
|
+
"enum": [
|
|
624
|
+
"no",
|
|
625
|
+
"deferrable",
|
|
626
|
+
"initiallyDeferred"
|
|
627
|
+
]
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
"required": [
|
|
631
|
+
"columns",
|
|
632
|
+
"references"
|
|
633
|
+
],
|
|
634
|
+
"additionalProperties": false,
|
|
635
|
+
"description": "Foreign key of the table."
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
"indexes": {
|
|
639
|
+
"default": [],
|
|
640
|
+
"description": "Indexes of the table.",
|
|
641
|
+
"type": "array",
|
|
642
|
+
"items": {
|
|
643
|
+
"type": "object",
|
|
644
|
+
"properties": {
|
|
645
|
+
"name": {
|
|
646
|
+
"description": "Constraint name; when absent the PostgreSQL default name is used.",
|
|
647
|
+
"type": "string",
|
|
648
|
+
"minLength": 1
|
|
649
|
+
},
|
|
650
|
+
"unique": {
|
|
651
|
+
"default": false,
|
|
652
|
+
"description": "Whether the index is unique.",
|
|
653
|
+
"type": "boolean"
|
|
654
|
+
},
|
|
655
|
+
"method": {
|
|
656
|
+
"default": "btree",
|
|
657
|
+
"description": "Index access method.",
|
|
658
|
+
"type": "string",
|
|
659
|
+
"minLength": 1
|
|
660
|
+
},
|
|
661
|
+
"keys": {
|
|
662
|
+
"minItems": 1,
|
|
663
|
+
"type": "array",
|
|
664
|
+
"items": {
|
|
665
|
+
"anyOf": [
|
|
666
|
+
{
|
|
667
|
+
"type": "object",
|
|
668
|
+
"properties": {
|
|
669
|
+
"column": {
|
|
670
|
+
"type": "string",
|
|
671
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
|
|
672
|
+
"description": "Logical name of the indexed column."
|
|
673
|
+
},
|
|
674
|
+
"order": {
|
|
675
|
+
"description": "Sort order of the key; absent means ascending.",
|
|
676
|
+
"type": "string",
|
|
677
|
+
"enum": [
|
|
678
|
+
"asc",
|
|
679
|
+
"desc"
|
|
680
|
+
]
|
|
681
|
+
},
|
|
682
|
+
"nulls": {
|
|
683
|
+
"description": "NULLS FIRST or NULLS LAST; absent means the order default.",
|
|
684
|
+
"type": "string",
|
|
685
|
+
"enum": [
|
|
686
|
+
"first",
|
|
687
|
+
"last"
|
|
688
|
+
]
|
|
689
|
+
},
|
|
690
|
+
"opclass": {
|
|
691
|
+
"description": "Operator class of the key (pg_opclass); absent means the type default.",
|
|
692
|
+
"type": "object",
|
|
693
|
+
"properties": {
|
|
694
|
+
"schema": {
|
|
695
|
+
"description": "Schema of the object, unquoted; omitted for objects in pg_catalog.",
|
|
696
|
+
"type": "string",
|
|
697
|
+
"minLength": 1
|
|
698
|
+
},
|
|
699
|
+
"name": {
|
|
700
|
+
"type": "string",
|
|
701
|
+
"minLength": 1,
|
|
702
|
+
"description": "Name of the object, unquoted, as Postgres reports it."
|
|
703
|
+
}
|
|
704
|
+
},
|
|
705
|
+
"required": [
|
|
706
|
+
"name"
|
|
707
|
+
],
|
|
708
|
+
"additionalProperties": false
|
|
709
|
+
},
|
|
710
|
+
"collation": {
|
|
711
|
+
"description": "Collation of the key (pg_collation); absent means the column default.",
|
|
712
|
+
"type": "object",
|
|
713
|
+
"properties": {
|
|
714
|
+
"schema": {
|
|
715
|
+
"description": "Schema of the object, unquoted; omitted for objects in pg_catalog.",
|
|
716
|
+
"type": "string",
|
|
717
|
+
"minLength": 1
|
|
718
|
+
},
|
|
719
|
+
"name": {
|
|
720
|
+
"type": "string",
|
|
721
|
+
"minLength": 1,
|
|
722
|
+
"description": "Name of the object, unquoted, as Postgres reports it."
|
|
723
|
+
}
|
|
724
|
+
},
|
|
725
|
+
"required": [
|
|
726
|
+
"name"
|
|
727
|
+
],
|
|
728
|
+
"additionalProperties": false
|
|
729
|
+
}
|
|
730
|
+
},
|
|
731
|
+
"required": [
|
|
732
|
+
"column"
|
|
733
|
+
],
|
|
734
|
+
"additionalProperties": false
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"type": "object",
|
|
738
|
+
"properties": {
|
|
739
|
+
"expression": {
|
|
740
|
+
"type": "string",
|
|
741
|
+
"minLength": 1,
|
|
742
|
+
"description": "SQL expression of the index key."
|
|
743
|
+
},
|
|
744
|
+
"order": {
|
|
745
|
+
"description": "Sort order of the key; absent means ascending.",
|
|
746
|
+
"type": "string",
|
|
747
|
+
"enum": [
|
|
748
|
+
"asc",
|
|
749
|
+
"desc"
|
|
750
|
+
]
|
|
751
|
+
},
|
|
752
|
+
"nulls": {
|
|
753
|
+
"description": "NULLS FIRST or NULLS LAST; absent means the order default.",
|
|
754
|
+
"type": "string",
|
|
755
|
+
"enum": [
|
|
756
|
+
"first",
|
|
757
|
+
"last"
|
|
758
|
+
]
|
|
759
|
+
},
|
|
760
|
+
"opclass": {
|
|
761
|
+
"description": "Operator class of the key (pg_opclass); absent means the type default.",
|
|
762
|
+
"type": "object",
|
|
763
|
+
"properties": {
|
|
764
|
+
"schema": {
|
|
765
|
+
"description": "Schema of the object, unquoted; omitted for objects in pg_catalog.",
|
|
766
|
+
"type": "string",
|
|
767
|
+
"minLength": 1
|
|
768
|
+
},
|
|
769
|
+
"name": {
|
|
770
|
+
"type": "string",
|
|
771
|
+
"minLength": 1,
|
|
772
|
+
"description": "Name of the object, unquoted, as Postgres reports it."
|
|
773
|
+
}
|
|
774
|
+
},
|
|
775
|
+
"required": [
|
|
776
|
+
"name"
|
|
777
|
+
],
|
|
778
|
+
"additionalProperties": false
|
|
779
|
+
},
|
|
780
|
+
"collation": {
|
|
781
|
+
"description": "Collation of the key (pg_collation); absent means the column default.",
|
|
782
|
+
"type": "object",
|
|
783
|
+
"properties": {
|
|
784
|
+
"schema": {
|
|
785
|
+
"description": "Schema of the object, unquoted; omitted for objects in pg_catalog.",
|
|
786
|
+
"type": "string",
|
|
787
|
+
"minLength": 1
|
|
788
|
+
},
|
|
789
|
+
"name": {
|
|
790
|
+
"type": "string",
|
|
791
|
+
"minLength": 1,
|
|
792
|
+
"description": "Name of the object, unquoted, as Postgres reports it."
|
|
793
|
+
}
|
|
794
|
+
},
|
|
795
|
+
"required": [
|
|
796
|
+
"name"
|
|
797
|
+
],
|
|
798
|
+
"additionalProperties": false
|
|
799
|
+
}
|
|
800
|
+
},
|
|
801
|
+
"required": [
|
|
802
|
+
"expression"
|
|
803
|
+
],
|
|
804
|
+
"additionalProperties": false
|
|
805
|
+
}
|
|
806
|
+
]
|
|
807
|
+
},
|
|
808
|
+
"description": "Index keys: columns or expressions."
|
|
809
|
+
},
|
|
810
|
+
"include": {
|
|
811
|
+
"default": [],
|
|
812
|
+
"description": "Logical names of non-key columns stored in the index.",
|
|
813
|
+
"type": "array",
|
|
814
|
+
"items": {
|
|
815
|
+
"type": "string",
|
|
816
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*$",
|
|
817
|
+
"description": "Logical element name (attribute, section, column). The casing style is checked against the project naming setting."
|
|
818
|
+
}
|
|
819
|
+
},
|
|
820
|
+
"where": {
|
|
821
|
+
"description": "SQL predicate of a partial index.",
|
|
822
|
+
"type": "string"
|
|
823
|
+
},
|
|
824
|
+
"nullsNotDistinct": {
|
|
825
|
+
"default": false,
|
|
826
|
+
"description": "Whether NULLs are treated as equal in a unique index.",
|
|
827
|
+
"type": "boolean"
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
"required": [
|
|
831
|
+
"keys"
|
|
832
|
+
],
|
|
833
|
+
"additionalProperties": false,
|
|
834
|
+
"description": "Index of the table."
|
|
835
|
+
}
|
|
836
|
+
},
|
|
837
|
+
"scopeColumn": {
|
|
838
|
+
"description": "Logical name of the own column that carries the scope.",
|
|
839
|
+
"type": "string",
|
|
840
|
+
"pattern": "^[A-Za-z][A-Za-z0-9_]*$"
|
|
841
|
+
},
|
|
842
|
+
"rowLevelSecurity": {
|
|
843
|
+
"default": "off",
|
|
844
|
+
"description": "Row-level security of the table: off, enabled, or forced (applies to the table owner too).",
|
|
845
|
+
"type": "string",
|
|
846
|
+
"enum": [
|
|
847
|
+
"off",
|
|
848
|
+
"enabled",
|
|
849
|
+
"forced"
|
|
850
|
+
]
|
|
851
|
+
}
|
|
852
|
+
},
|
|
853
|
+
"required": [
|
|
854
|
+
"name",
|
|
855
|
+
"kind",
|
|
856
|
+
"columns"
|
|
857
|
+
],
|
|
858
|
+
"additionalProperties": false,
|
|
859
|
+
"$id": "custom-tables.schema.json"
|
|
860
|
+
}
|