@intentius/sql-yodeler 0.1.0 → 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/README.md +26 -24
- package/dist/bin.js +15 -0
- package/dist/bin.js.map +1 -1
- package/dist/chant/apply.d.ts +9 -1
- package/dist/chant/apply.js +13 -1
- package/dist/chant/apply.js.map +1 -1
- package/dist/chant/drift.d.ts +69 -1
- package/dist/chant/drift.js +152 -5
- package/dist/chant/drift.js.map +1 -1
- package/dist/chant/runnable.d.ts +19 -0
- package/dist/chant/runnable.js +47 -0
- package/dist/chant/runnable.js.map +1 -0
- package/dist/cli.d.ts +4 -0
- package/dist/cli.js +40 -0
- package/dist/cli.js.map +1 -1
- package/dist/command.d.ts +6 -0
- package/dist/command.js.map +1 -1
- package/dist/commands/apply.js +161 -41
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/approve.d.ts +5 -0
- package/dist/commands/approve.js +111 -0
- package/dist/commands/approve.js.map +1 -0
- package/dist/commands/drift.d.ts +11 -0
- package/dist/commands/drift.js +247 -18
- package/dist/commands/drift.js.map +1 -1
- package/dist/commands/index.js +6 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.js +15 -11
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/lint.js +14 -5
- package/dist/commands/lint.js.map +1 -1
- package/dist/commands/mcp.d.ts +3 -0
- package/dist/commands/mcp.js +50 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/new.d.ts +2 -0
- package/dist/commands/new.js +134 -10
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/override.d.ts +3 -0
- package/dist/commands/override.js +118 -0
- package/dist/commands/override.js.map +1 -0
- package/dist/commands/plan.js +38 -26
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/repair.d.ts +11 -0
- package/dist/commands/repair.js +15 -7
- package/dist/commands/repair.js.map +1 -1
- package/dist/commands/status.js +12 -12
- package/dist/commands/status.js.map +1 -1
- package/dist/config/define.d.ts +101 -3
- package/dist/config/define.js +1 -1
- package/dist/config/define.js.map +1 -1
- package/dist/config/load.js +64 -4
- package/dist/config/load.js.map +1 -1
- package/dist/config/settings.d.ts +14 -1
- package/dist/config/settings.js +32 -4
- package/dist/config/settings.js.map +1 -1
- package/dist/env-args.d.ts +6 -0
- package/dist/env-args.js +31 -1
- package/dist/env-args.js.map +1 -1
- package/dist/exit.d.ts +20 -0
- package/dist/exit.js +28 -0
- package/dist/exit.js.map +1 -0
- package/dist/history/client.d.ts +8 -0
- package/dist/history/client.js +24 -1
- package/dist/history/client.js.map +1 -1
- package/dist/history/lock.d.ts +5 -1
- package/dist/history/lock.js +8 -2
- package/dist/history/lock.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/init/adopt.js +8 -3
- package/dist/init/adopt.js.map +1 -1
- package/dist/init/live.d.ts +11 -0
- package/dist/init/live.js +25 -2
- package/dist/init/live.js.map +1 -1
- package/dist/lint/check.d.ts +8 -1
- package/dist/lint/check.js +23 -4
- package/dist/lint/check.js.map +1 -1
- package/dist/mcp/server.d.ts +40 -0
- package/dist/mcp/server.js +106 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +72 -0
- package/dist/mcp/tools.js +178 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/migrations/checks.d.ts +28 -0
- package/dist/migrations/checks.js +97 -0
- package/dist/migrations/checks.js.map +1 -0
- package/dist/migrations/create.d.ts +3 -1
- package/dist/migrations/create.js +1 -0
- package/dist/migrations/create.js.map +1 -1
- package/dist/migrations/directory.js +4 -0
- package/dist/migrations/directory.js.map +1 -1
- package/dist/migrations/document.d.ts +23 -0
- package/dist/migrations/document.js +1 -0
- package/dist/migrations/document.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.js +1 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/pr/forge.d.ts +4 -0
- package/dist/pr/forge.js +21 -7
- package/dist/pr/forge.js.map +1 -1
- package/dist/pr/issue.d.ts +68 -0
- package/dist/pr/issue.js +107 -0
- package/dist/pr/issue.js.map +1 -0
- package/dist/pr/model.d.ts +9 -1
- package/dist/pr/model.js +30 -6
- package/dist/pr/model.js.map +1 -1
- package/dist/pr/render.d.ts +3 -1
- package/dist/pr/render.js +36 -3
- package/dist/pr/render.js.map +1 -1
- package/dist/replay/index.d.ts +3 -0
- package/dist/replay/index.js +3 -0
- package/dist/replay/index.js.map +1 -1
- package/dist/replay/replay.js +1 -1
- package/dist/replay/replay.js.map +1 -1
- package/dist/replay/shared.d.ts +28 -0
- package/dist/replay/shared.js +77 -0
- package/dist/replay/shared.js.map +1 -0
- package/dist/schemas.d.ts +34 -0
- package/dist/schemas.js +38 -0
- package/dist/schemas.js.map +1 -0
- package/dist/server.d.ts +40 -0
- package/dist/server.js +87 -0
- package/dist/server.js.map +1 -0
- package/dist/steps/backfill.d.ts +21 -17
- package/dist/steps/backfill.js +20 -20
- package/dist/steps/backfill.js.map +1 -1
- package/dist/steps/index.d.ts +2 -2
- package/dist/steps/index.js +3 -3
- package/dist/steps/index.js.map +1 -1
- package/dist/steps/rebuild.d.ts +15 -15
- package/dist/steps/rebuild.js +17 -24
- package/dist/steps/rebuild.js.map +1 -1
- package/dist/versioned/checks.d.ts +29 -0
- package/dist/versioned/checks.js +54 -0
- package/dist/versioned/checks.js.map +1 -0
- package/dist/versioned/clickhouse.js +8 -0
- package/dist/versioned/clickhouse.js.map +1 -1
- package/dist/versioned/driver.d.ts +10 -0
- package/dist/versioned/engine.d.ts +55 -1
- package/dist/versioned/engine.js +99 -6
- package/dist/versioned/engine.js.map +1 -1
- package/dist/versioned/explain.js +7 -2
- package/dist/versioned/explain.js.map +1 -1
- package/dist/versioned/index.d.ts +9 -0
- package/dist/versioned/index.js +24 -1
- package/dist/versioned/index.js.map +1 -1
- package/dist/versioned/op.d.ts +10 -0
- package/dist/versioned/op.js +36 -4
- package/dist/versioned/op.js.map +1 -1
- package/dist/versioned/policy.d.ts +67 -0
- package/dist/versioned/policy.js +161 -0
- package/dist/versioned/policy.js.map +1 -0
- package/dist/versioned/postgres/driver.d.ts +3 -1
- package/dist/versioned/postgres/driver.js +30 -3
- package/dist/versioned/postgres/driver.js.map +1 -1
- package/dist/versioned/postgres/waits.d.ts +46 -0
- package/dist/versioned/postgres/waits.js +78 -0
- package/dist/versioned/postgres/waits.js.map +1 -0
- package/dist/versioned/report.d.ts +3 -0
- package/dist/versioned/report.js +4 -1
- package/dist/versioned/report.js.map +1 -1
- package/dist/versioned/stand-down.d.ts +30 -0
- package/dist/versioned/stand-down.js +56 -0
- package/dist/versioned/stand-down.js.map +1 -0
- package/package.json +18 -8
- package/schemas/apply.schema.json +269 -0
- package/schemas/common.schema.json +213 -0
- package/schemas/drift.schema.json +36 -0
- package/schemas/init.schema.json +31 -0
- package/schemas/lint-rules.schema.json +54 -0
- package/schemas/lint.schema.json +290 -0
- package/schemas/mcp.schema.json +70 -0
- package/schemas/new.schema.json +71 -0
- package/schemas/plan.schema.json +371 -0
- package/schemas/rebase.schema.json +54 -0
- package/schemas/repair.schema.json +20 -0
- package/schemas/status.schema.json +310 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/common.schema.json",
|
|
4
|
+
"title": "Definitions the yodel --json schemas share",
|
|
5
|
+
"description": "Version 1. Shared by the other schemas in this directory; no command prints this document on its own.",
|
|
6
|
+
"$defs": {
|
|
7
|
+
"dialect": {
|
|
8
|
+
"enum": [
|
|
9
|
+
"clickhouse",
|
|
10
|
+
"postgres"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
"server": {
|
|
14
|
+
"description": "The server read from: its dialect, its address (host:port on ClickHouse, host:port/database on Postgres) and its version, when it answered.",
|
|
15
|
+
"type": "object",
|
|
16
|
+
"additionalProperties": false,
|
|
17
|
+
"required": [
|
|
18
|
+
"dialect",
|
|
19
|
+
"address"
|
|
20
|
+
],
|
|
21
|
+
"properties": {
|
|
22
|
+
"dialect": {
|
|
23
|
+
"$ref": "#/$defs/dialect"
|
|
24
|
+
},
|
|
25
|
+
"address": {
|
|
26
|
+
"type": "string"
|
|
27
|
+
},
|
|
28
|
+
"version": {
|
|
29
|
+
"type": "string"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"refusal": {
|
|
34
|
+
"description": "Why yodel apply would refuse, and the exit code it would refuse with.",
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"required": [
|
|
38
|
+
"exitCode",
|
|
39
|
+
"message"
|
|
40
|
+
],
|
|
41
|
+
"properties": {
|
|
42
|
+
"exitCode": {
|
|
43
|
+
"type": "integer"
|
|
44
|
+
},
|
|
45
|
+
"message": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"change": {
|
|
51
|
+
"description": "One classified change, as chant's sql lexicon reports it. chant owns this object: fields beyond the required ones may appear.",
|
|
52
|
+
"type": "object",
|
|
53
|
+
"required": [
|
|
54
|
+
"object",
|
|
55
|
+
"field",
|
|
56
|
+
"rule",
|
|
57
|
+
"class"
|
|
58
|
+
],
|
|
59
|
+
"properties": {
|
|
60
|
+
"object": {
|
|
61
|
+
"type": "string"
|
|
62
|
+
},
|
|
63
|
+
"field": {
|
|
64
|
+
"type": "string"
|
|
65
|
+
},
|
|
66
|
+
"before": {
|
|
67
|
+
"type": "string"
|
|
68
|
+
},
|
|
69
|
+
"after": {
|
|
70
|
+
"type": "string"
|
|
71
|
+
},
|
|
72
|
+
"rule": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"class": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"destructive": {
|
|
79
|
+
"type": "boolean"
|
|
80
|
+
},
|
|
81
|
+
"note": {
|
|
82
|
+
"type": "string"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"check": {
|
|
87
|
+
"description": "A pre-migration check from migration.json.",
|
|
88
|
+
"type": "object",
|
|
89
|
+
"additionalProperties": false,
|
|
90
|
+
"required": [
|
|
91
|
+
"name",
|
|
92
|
+
"sql"
|
|
93
|
+
],
|
|
94
|
+
"properties": {
|
|
95
|
+
"name": {
|
|
96
|
+
"type": "string"
|
|
97
|
+
},
|
|
98
|
+
"sql": {
|
|
99
|
+
"type": "string"
|
|
100
|
+
},
|
|
101
|
+
"expect": {
|
|
102
|
+
"oneOf": [
|
|
103
|
+
{
|
|
104
|
+
"enum": [
|
|
105
|
+
"empty",
|
|
106
|
+
"true"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"type": "object",
|
|
111
|
+
"additionalProperties": false,
|
|
112
|
+
"properties": {
|
|
113
|
+
"min": {
|
|
114
|
+
"type": "number"
|
|
115
|
+
},
|
|
116
|
+
"max": {
|
|
117
|
+
"type": "number"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"checkOutcome": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"additionalProperties": false,
|
|
128
|
+
"required": [
|
|
129
|
+
"name",
|
|
130
|
+
"passed",
|
|
131
|
+
"detail"
|
|
132
|
+
],
|
|
133
|
+
"properties": {
|
|
134
|
+
"name": {
|
|
135
|
+
"type": "string"
|
|
136
|
+
},
|
|
137
|
+
"passed": {
|
|
138
|
+
"type": "boolean"
|
|
139
|
+
},
|
|
140
|
+
"detail": {
|
|
141
|
+
"type": "string"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"stringList": {
|
|
146
|
+
"type": "array",
|
|
147
|
+
"items": {
|
|
148
|
+
"type": "string"
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"policy": {
|
|
152
|
+
"description": "The outcome of each rule of yodel.config.ts policy.rules over the plan.",
|
|
153
|
+
"type": "array",
|
|
154
|
+
"items": {
|
|
155
|
+
"type": "object",
|
|
156
|
+
"additionalProperties": false,
|
|
157
|
+
"required": [
|
|
158
|
+
"id",
|
|
159
|
+
"outcome",
|
|
160
|
+
"reasons"
|
|
161
|
+
],
|
|
162
|
+
"properties": {
|
|
163
|
+
"id": {
|
|
164
|
+
"type": "string"
|
|
165
|
+
},
|
|
166
|
+
"description": {
|
|
167
|
+
"type": "string"
|
|
168
|
+
},
|
|
169
|
+
"outcome": {
|
|
170
|
+
"description": "denied stands; overridden was denied, and an override counts.",
|
|
171
|
+
"enum": [
|
|
172
|
+
"allowed",
|
|
173
|
+
"denied",
|
|
174
|
+
"overridden"
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
"reasons": {
|
|
178
|
+
"description": "Why it denies the plan, one line each.",
|
|
179
|
+
"$ref": "#/$defs/stringList"
|
|
180
|
+
},
|
|
181
|
+
"override": {
|
|
182
|
+
"type": "object",
|
|
183
|
+
"additionalProperties": false,
|
|
184
|
+
"required": [
|
|
185
|
+
"rule",
|
|
186
|
+
"by",
|
|
187
|
+
"at",
|
|
188
|
+
"reason",
|
|
189
|
+
"digest"
|
|
190
|
+
],
|
|
191
|
+
"properties": {
|
|
192
|
+
"rule": {
|
|
193
|
+
"type": "string"
|
|
194
|
+
},
|
|
195
|
+
"by": {
|
|
196
|
+
"type": "string"
|
|
197
|
+
},
|
|
198
|
+
"at": {
|
|
199
|
+
"type": "string"
|
|
200
|
+
},
|
|
201
|
+
"reason": {
|
|
202
|
+
"type": "string"
|
|
203
|
+
},
|
|
204
|
+
"digest": {
|
|
205
|
+
"type": "string"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/drift.schema.json",
|
|
4
|
+
"title": "yodel drift <env> --json",
|
|
5
|
+
"description": "Version 1. The declared objects changed out of band (changed) or gone (missing), and those chant could not read (unobserved: not drift, and not clean). Objects the project does not declare are never reported. Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["environment", "dialect", "changed", "missing", "unobserved", "drifted"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"environment": { "type": "string" },
|
|
11
|
+
"dialect": { "$ref": "common.schema.json#/$defs/dialect" },
|
|
12
|
+
"server": { "$ref": "common.schema.json#/$defs/server" },
|
|
13
|
+
"changed": {
|
|
14
|
+
"description": "chant's deep drift for each changed object: its name, kind and the properties that differ, declared against live. chant owns this object: fields beyond the required ones may appear.",
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "object",
|
|
18
|
+
"required": ["changes"],
|
|
19
|
+
"properties": { "changes": { "type": "array", "items": { "type": "object" } } }
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"missing": { "$ref": "common.schema.json#/$defs/stringList" },
|
|
23
|
+
"unobserved": {
|
|
24
|
+
"description": "Declared objects chant could not read, each with its name and why.",
|
|
25
|
+
"type": "array",
|
|
26
|
+
"items": { "type": "object", "required": ["name"], "properties": { "name": { "type": "string" } } }
|
|
27
|
+
},
|
|
28
|
+
"lockWait": { "description": "Postgres: a read gave up at the lock timeout, and what it waited on.", "type": "string" },
|
|
29
|
+
"columns": {
|
|
30
|
+
"description": "Each changed table's declared column names, by position.",
|
|
31
|
+
"type": "object",
|
|
32
|
+
"additionalProperties": { "$ref": "common.schema.json#/$defs/stringList" }
|
|
33
|
+
},
|
|
34
|
+
"drifted": { "description": "A declared object changed or is gone: the command exits 2.", "type": "boolean" }
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/init.schema.json",
|
|
4
|
+
"title": "yodel init --from <env> --json",
|
|
5
|
+
"description": "Version 1. What adopting a live database wrote: the declarations, the baseline migration, and the history row that records it applied. Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["environment", "dialect", "status", "objects", "schemaFiles", "migration", "recorded", "warnings"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"environment": { "type": "string" },
|
|
11
|
+
"dialect": { "$ref": "common.schema.json#/$defs/dialect" },
|
|
12
|
+
"status": { "const": "adopted" },
|
|
13
|
+
"objects": { "description": "The objects read, as <kind> <name>.", "$ref": "common.schema.json#/$defs/stringList" },
|
|
14
|
+
"schemaFiles": { "description": "The declaration files written, relative to the project.", "$ref": "common.schema.json#/$defs/stringList" },
|
|
15
|
+
"migration": {
|
|
16
|
+
"description": "The baseline migration.",
|
|
17
|
+
"type": "object",
|
|
18
|
+
"additionalProperties": false,
|
|
19
|
+
"required": ["path", "id", "checksum", "statements"],
|
|
20
|
+
"properties": { "path": { "type": "string" }, "id": { "type": "string" }, "checksum": { "type": "string" }, "statements": { "type": "integer" } }
|
|
21
|
+
},
|
|
22
|
+
"recorded": {
|
|
23
|
+
"description": "The baseline's history row.",
|
|
24
|
+
"type": "object",
|
|
25
|
+
"additionalProperties": false,
|
|
26
|
+
"required": ["history", "seq", "note", "appliedBy"],
|
|
27
|
+
"properties": { "history": { "type": "string" }, "seq": { "type": "integer" }, "note": { "type": "string" }, "appliedBy": { "type": "string" } }
|
|
28
|
+
},
|
|
29
|
+
"warnings": { "$ref": "common.schema.json#/$defs/stringList" }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/lint-rules.schema.json",
|
|
4
|
+
"title": "yodel lint --rules --json",
|
|
5
|
+
"description": "Version 1. Every lint rule, with the level yodel.config.ts sets for it in this project. Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"type": "array",
|
|
7
|
+
"items": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"required": [
|
|
11
|
+
"id",
|
|
12
|
+
"summary",
|
|
13
|
+
"level",
|
|
14
|
+
"silenceable",
|
|
15
|
+
"configurable",
|
|
16
|
+
"configured"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"id": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"summary": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
},
|
|
25
|
+
"level": {
|
|
26
|
+
"description": "The rule's default level.",
|
|
27
|
+
"enum": [
|
|
28
|
+
"error",
|
|
29
|
+
"warning"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"silenceable": {
|
|
33
|
+
"description": "A -- yodel:allow <id> <reason> line can silence it for one statement.",
|
|
34
|
+
"type": "boolean"
|
|
35
|
+
},
|
|
36
|
+
"configurable": {
|
|
37
|
+
"description": "yodel.config.ts lint.rules may change its level.",
|
|
38
|
+
"type": "boolean"
|
|
39
|
+
},
|
|
40
|
+
"dialect": {
|
|
41
|
+
"description": "The dialect it applies to; both when absent.",
|
|
42
|
+
"$ref": "common.schema.json#/$defs/dialect"
|
|
43
|
+
},
|
|
44
|
+
"configured": {
|
|
45
|
+
"description": "The level in this project.",
|
|
46
|
+
"enum": [
|
|
47
|
+
"error",
|
|
48
|
+
"warning",
|
|
49
|
+
"off"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://intentius.io/sql-yodeler/schemas/v1/lint.schema.json",
|
|
4
|
+
"title": "yodel lint --json",
|
|
5
|
+
"description": "Version 1. The findings, the silences each migration holds, and with --replay the replay check's result. yodel lint --rules --json prints lint-rules.schema.json instead. Within a version, fields are only added; a reader ignores fields it does not know.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"status",
|
|
10
|
+
"dialect",
|
|
11
|
+
"migrations",
|
|
12
|
+
"errors",
|
|
13
|
+
"warnings",
|
|
14
|
+
"silenced",
|
|
15
|
+
"findings",
|
|
16
|
+
"silences"
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"status": {
|
|
20
|
+
"description": "failed when a finding at level error is not silenced: the command exits 3.",
|
|
21
|
+
"enum": [
|
|
22
|
+
"passed",
|
|
23
|
+
"failed"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"environment": {
|
|
27
|
+
"description": "With --env: the environment whose history the migrations were compared with.",
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"dialect": {
|
|
31
|
+
"oneOf": [
|
|
32
|
+
{
|
|
33
|
+
"$ref": "common.schema.json#/$defs/dialect"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "null"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
"migrations": {
|
|
41
|
+
"description": "Every migration read, sorted by id.",
|
|
42
|
+
"$ref": "common.schema.json#/$defs/stringList"
|
|
43
|
+
},
|
|
44
|
+
"errors": {
|
|
45
|
+
"type": "integer",
|
|
46
|
+
"minimum": 0
|
|
47
|
+
},
|
|
48
|
+
"warnings": {
|
|
49
|
+
"type": "integer",
|
|
50
|
+
"minimum": 0
|
|
51
|
+
},
|
|
52
|
+
"silenced": {
|
|
53
|
+
"type": "integer",
|
|
54
|
+
"minimum": 0
|
|
55
|
+
},
|
|
56
|
+
"findings": {
|
|
57
|
+
"type": "array",
|
|
58
|
+
"items": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"additionalProperties": false,
|
|
61
|
+
"required": [
|
|
62
|
+
"rule",
|
|
63
|
+
"level",
|
|
64
|
+
"message"
|
|
65
|
+
],
|
|
66
|
+
"properties": {
|
|
67
|
+
"rule": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"level": {
|
|
71
|
+
"enum": [
|
|
72
|
+
"error",
|
|
73
|
+
"warning"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"message": {
|
|
77
|
+
"type": "string"
|
|
78
|
+
},
|
|
79
|
+
"migration": {
|
|
80
|
+
"type": "string"
|
|
81
|
+
},
|
|
82
|
+
"step": {
|
|
83
|
+
"type": "integer"
|
|
84
|
+
},
|
|
85
|
+
"object": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
"line": {
|
|
89
|
+
"type": "integer"
|
|
90
|
+
},
|
|
91
|
+
"silenced": {
|
|
92
|
+
"description": "A -- yodel:allow line silenced it: the reason given. A silenced finding fails nothing.",
|
|
93
|
+
"type": "string"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"silences": {
|
|
99
|
+
"description": "The silences each migration's migration.sql holds, by migration id.",
|
|
100
|
+
"type": "object",
|
|
101
|
+
"additionalProperties": {
|
|
102
|
+
"type": "array",
|
|
103
|
+
"items": {
|
|
104
|
+
"type": "object",
|
|
105
|
+
"additionalProperties": false,
|
|
106
|
+
"required": [
|
|
107
|
+
"step",
|
|
108
|
+
"rule",
|
|
109
|
+
"reason",
|
|
110
|
+
"line"
|
|
111
|
+
],
|
|
112
|
+
"properties": {
|
|
113
|
+
"step": {
|
|
114
|
+
"type": "integer"
|
|
115
|
+
},
|
|
116
|
+
"rule": {
|
|
117
|
+
"type": "string"
|
|
118
|
+
},
|
|
119
|
+
"reason": {
|
|
120
|
+
"type": "string"
|
|
121
|
+
},
|
|
122
|
+
"line": {
|
|
123
|
+
"type": "integer"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"replay": {
|
|
130
|
+
"$ref": "#/$defs/replay"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"$defs": {
|
|
134
|
+
"replayed": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"additionalProperties": false,
|
|
137
|
+
"required": [
|
|
138
|
+
"id",
|
|
139
|
+
"statements",
|
|
140
|
+
"ran",
|
|
141
|
+
"skipped"
|
|
142
|
+
],
|
|
143
|
+
"properties": {
|
|
144
|
+
"id": {
|
|
145
|
+
"type": "string"
|
|
146
|
+
},
|
|
147
|
+
"statements": {
|
|
148
|
+
"type": "integer"
|
|
149
|
+
},
|
|
150
|
+
"ran": {
|
|
151
|
+
"$ref": "common.schema.json#/$defs/stringList"
|
|
152
|
+
},
|
|
153
|
+
"skipped": {
|
|
154
|
+
"$ref": "common.schema.json#/$defs/stringList"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"replay": {
|
|
159
|
+
"description": "With --replay: the history replayed into an empty database, migration by migration, against each one's recorded schema.",
|
|
160
|
+
"type": "object",
|
|
161
|
+
"required": [
|
|
162
|
+
"dialect",
|
|
163
|
+
"where",
|
|
164
|
+
"scope",
|
|
165
|
+
"reset",
|
|
166
|
+
"kept",
|
|
167
|
+
"matched",
|
|
168
|
+
"total",
|
|
169
|
+
"outcome",
|
|
170
|
+
"ok"
|
|
171
|
+
],
|
|
172
|
+
"unevaluatedProperties": false,
|
|
173
|
+
"properties": {
|
|
174
|
+
"dialect": {
|
|
175
|
+
"$ref": "common.schema.json#/$defs/dialect"
|
|
176
|
+
},
|
|
177
|
+
"where": {
|
|
178
|
+
"type": "string"
|
|
179
|
+
},
|
|
180
|
+
"scope": {
|
|
181
|
+
"$ref": "common.schema.json#/$defs/stringList"
|
|
182
|
+
},
|
|
183
|
+
"reset": {
|
|
184
|
+
"type": "boolean"
|
|
185
|
+
},
|
|
186
|
+
"kept": {
|
|
187
|
+
"type": "boolean"
|
|
188
|
+
},
|
|
189
|
+
"matched": {
|
|
190
|
+
"type": "array",
|
|
191
|
+
"items": {
|
|
192
|
+
"$ref": "#/$defs/replayed"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"total": {
|
|
196
|
+
"type": "integer"
|
|
197
|
+
},
|
|
198
|
+
"outcome": {
|
|
199
|
+
"enum": [
|
|
200
|
+
"matches",
|
|
201
|
+
"differs",
|
|
202
|
+
"failed",
|
|
203
|
+
"unreplayable"
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
"ok": {
|
|
207
|
+
"type": "boolean"
|
|
208
|
+
},
|
|
209
|
+
"message": {
|
|
210
|
+
"type": "string"
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"oneOf": [
|
|
214
|
+
{
|
|
215
|
+
"properties": {
|
|
216
|
+
"outcome": {
|
|
217
|
+
"const": "matches"
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"type": "object"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"required": [
|
|
224
|
+
"migration",
|
|
225
|
+
"changes"
|
|
226
|
+
],
|
|
227
|
+
"properties": {
|
|
228
|
+
"outcome": {
|
|
229
|
+
"const": "differs"
|
|
230
|
+
},
|
|
231
|
+
"migration": {
|
|
232
|
+
"$ref": "#/$defs/replayed"
|
|
233
|
+
},
|
|
234
|
+
"changes": {
|
|
235
|
+
"type": "array",
|
|
236
|
+
"items": {
|
|
237
|
+
"$ref": "common.schema.json#/$defs/change"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
"type": "object"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
"required": [
|
|
245
|
+
"migration",
|
|
246
|
+
"step",
|
|
247
|
+
"error"
|
|
248
|
+
],
|
|
249
|
+
"properties": {
|
|
250
|
+
"outcome": {
|
|
251
|
+
"const": "failed"
|
|
252
|
+
},
|
|
253
|
+
"migration": {
|
|
254
|
+
"type": "string"
|
|
255
|
+
},
|
|
256
|
+
"step": {
|
|
257
|
+
"type": "integer"
|
|
258
|
+
},
|
|
259
|
+
"error": {
|
|
260
|
+
"type": "string"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
"type": "object"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"required": [
|
|
267
|
+
"migration",
|
|
268
|
+
"step",
|
|
269
|
+
"reason"
|
|
270
|
+
],
|
|
271
|
+
"properties": {
|
|
272
|
+
"outcome": {
|
|
273
|
+
"const": "unreplayable"
|
|
274
|
+
},
|
|
275
|
+
"migration": {
|
|
276
|
+
"type": "string"
|
|
277
|
+
},
|
|
278
|
+
"step": {
|
|
279
|
+
"type": "integer"
|
|
280
|
+
},
|
|
281
|
+
"reason": {
|
|
282
|
+
"type": "string"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"type": "object"
|
|
286
|
+
}
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|