postgresai 0.19.0-rc.4 → 0.19.0-rc.5
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/dist/bin/postgres-ai.js +2 -2
- package/dist/sql/06.helpers.sql +2 -1
- package/package.json +1 -1
- package/schemas/K005.schema.json +173 -5
- package/sql/06.helpers.sql +2 -1
package/dist/bin/postgres-ai.js
CHANGED
|
@@ -13538,7 +13538,7 @@ var {
|
|
|
13538
13538
|
// package.json
|
|
13539
13539
|
var package_default = {
|
|
13540
13540
|
name: "postgresai",
|
|
13541
|
-
version: "0.19.0-rc.
|
|
13541
|
+
version: "0.19.0-rc.5",
|
|
13542
13542
|
description: "postgres_ai CLI",
|
|
13543
13543
|
license: "Apache-2.0",
|
|
13544
13544
|
private: false,
|
|
@@ -16898,7 +16898,7 @@ var Result = import_lib.default.Result;
|
|
|
16898
16898
|
var TypeOverrides = import_lib.default.TypeOverrides;
|
|
16899
16899
|
var defaults = import_lib.default.defaults;
|
|
16900
16900
|
// package.json
|
|
16901
|
-
var version = "0.19.0-rc.
|
|
16901
|
+
var version = "0.19.0-rc.5";
|
|
16902
16902
|
var package_default2 = {
|
|
16903
16903
|
name: "postgresai",
|
|
16904
16904
|
version,
|
package/dist/sql/06.helpers.sql
CHANGED
|
@@ -231,7 +231,8 @@ begin
|
|
|
231
231
|
pg_get_constraintdef(oid, true) as condef
|
|
232
232
|
from pg_constraint
|
|
233
233
|
where conrelid = v_oid
|
|
234
|
-
|
|
234
|
+
-- p: shown with the indexes; n (PG18+): Columns already says NOT NULL
|
|
235
|
+
and contype not in ('p', 'n')
|
|
235
236
|
order by
|
|
236
237
|
case contype when 'f' then 1 when 'u' then 2 when 'c' then 3 else 4 end,
|
|
237
238
|
conname
|
package/package.json
CHANGED
package/schemas/K005.schema.json
CHANGED
|
@@ -56,7 +56,114 @@
|
|
|
56
56
|
"properties": {
|
|
57
57
|
"queryid": { "type": "string" },
|
|
58
58
|
"total_wal_bytes": { "type": "number" },
|
|
59
|
-
"hourly_wal_bytes": { "$ref": "#/$defs/hourlyNumbers" }
|
|
59
|
+
"hourly_wal_bytes": { "$ref": "#/$defs/hourlyNumbers" },
|
|
60
|
+
"calls": { "type": "number" },
|
|
61
|
+
"exec_time_ms": { "type": "number" },
|
|
62
|
+
"rows": { "type": "number" },
|
|
63
|
+
"shared_blks_hit_bytes": { "type": "number" },
|
|
64
|
+
"shared_blks_read_bytes": { "type": "number" },
|
|
65
|
+
"wal_bytes": { "type": "number" },
|
|
66
|
+
"temp_bytes_written": { "type": "number" },
|
|
67
|
+
"wal_fpi": { "type": "number" },
|
|
68
|
+
"wal_records": { "type": "number" },
|
|
69
|
+
"query_text": { "type": "string" },
|
|
70
|
+
"is_monitoring": { "type": "boolean" },
|
|
71
|
+
"relations": { "type": "array", "items": { "type": "string" }, "maxItems": 3 }
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"exportRule": {
|
|
75
|
+
"type": "object",
|
|
76
|
+
"additionalProperties": false,
|
|
77
|
+
"required": ["top_n_per_database", "ranked_by", "min_calls", "min_exec_time_ms", "interval_seconds"],
|
|
78
|
+
"properties": {
|
|
79
|
+
"top_n_per_database": { "type": "integer" },
|
|
80
|
+
"ranked_by": { "type": "string" },
|
|
81
|
+
"min_calls": { "type": "integer" },
|
|
82
|
+
"min_exec_time_ms": { "type": "number" },
|
|
83
|
+
"interval_seconds": { "type": "integer" }
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"counterHours": {
|
|
87
|
+
"type": "object",
|
|
88
|
+
"additionalProperties": false,
|
|
89
|
+
"required": ["start", "end", "total", "hourly"],
|
|
90
|
+
"properties": {
|
|
91
|
+
"start": { "type": "string" },
|
|
92
|
+
"end": { "type": "string" },
|
|
93
|
+
"total": { "type": "number" },
|
|
94
|
+
"hourly": { "$ref": "#/$defs/hourlyNumbers" },
|
|
95
|
+
"peak_per_s": { "type": "number" },
|
|
96
|
+
"peak_at": { "type": "string" },
|
|
97
|
+
"peak_15m": {
|
|
98
|
+
"type": "object",
|
|
99
|
+
"additionalProperties": false,
|
|
100
|
+
"required": ["bytes", "seconds", "end"],
|
|
101
|
+
"properties": { "bytes": { "type": "number" }, "seconds": { "type": "integer" }, "end": { "type": "string" } }
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"gaugeEnds": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"additionalProperties": false,
|
|
108
|
+
"required": ["start", "end", "first", "last", "max", "max_at"],
|
|
109
|
+
"properties": {
|
|
110
|
+
"start": { "type": "string" },
|
|
111
|
+
"end": { "type": "string" },
|
|
112
|
+
"first": { "type": "number" },
|
|
113
|
+
"last": { "type": "number" },
|
|
114
|
+
"max": { "type": "number" },
|
|
115
|
+
"max_at": { "type": "string" }
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"setting": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"additionalProperties": false,
|
|
121
|
+
"required": ["setting", "unit", "context"],
|
|
122
|
+
"properties": {
|
|
123
|
+
"setting": { "type": "string" },
|
|
124
|
+
"unit": { "type": "string" },
|
|
125
|
+
"context": { "type": "string" }
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"slot": {
|
|
129
|
+
"type": "object",
|
|
130
|
+
"additionalProperties": false,
|
|
131
|
+
"required": ["slot_name", "slot_type", "active", "wal_status"],
|
|
132
|
+
"properties": {
|
|
133
|
+
"slot_name": { "type": "string" },
|
|
134
|
+
"slot_type": { "type": "string" },
|
|
135
|
+
"active": { "type": "boolean" },
|
|
136
|
+
"wal_status": { "type": "string" },
|
|
137
|
+
"retained_bytes": { "type": "number" }
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"index": {
|
|
141
|
+
"type": "object",
|
|
142
|
+
"additionalProperties": false,
|
|
143
|
+
"required": ["name", "bytes", "unique", "primary"],
|
|
144
|
+
"properties": {
|
|
145
|
+
"name": { "type": "string" },
|
|
146
|
+
"bytes": { "type": "number" },
|
|
147
|
+
"unique": { "type": "boolean" },
|
|
148
|
+
"primary": { "type": "boolean" },
|
|
149
|
+
"predicate": { "type": "string" },
|
|
150
|
+
"scans": { "type": "number" }
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
"table": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"additionalProperties": false,
|
|
156
|
+
"required": ["database", "schema", "table", "updates"],
|
|
157
|
+
"properties": {
|
|
158
|
+
"database": { "type": "string" },
|
|
159
|
+
"schema": { "type": "string" },
|
|
160
|
+
"table": { "type": "string" },
|
|
161
|
+
"updates": { "type": "number" },
|
|
162
|
+
"hot_updates": { "type": "number" },
|
|
163
|
+
"inserts": { "type": "number" },
|
|
164
|
+
"deletes": { "type": "number" },
|
|
165
|
+
"total_bytes": { "type": "number" },
|
|
166
|
+
"indexes": { "type": "array", "items": { "$ref": "#/$defs/index" } }
|
|
60
167
|
}
|
|
61
168
|
},
|
|
62
169
|
"summary": {
|
|
@@ -78,7 +185,17 @@
|
|
|
78
185
|
"total_wal_bytes_other": { "type": "number" },
|
|
79
186
|
"time_range_hours": { "type": "integer" },
|
|
80
187
|
"hourly_timestamps": { "$ref": "#/$defs/timeline" },
|
|
81
|
-
"limit": { "type": "integer" }
|
|
188
|
+
"limit": { "type": "integer" },
|
|
189
|
+
"window_start": { "type": "string" },
|
|
190
|
+
"window_end": { "type": "string" },
|
|
191
|
+
"window_seconds": { "type": "integer" },
|
|
192
|
+
"export_rule": { "$ref": "#/$defs/exportRule" },
|
|
193
|
+
"total_calls": { "type": "number" },
|
|
194
|
+
"statements_exported_max": { "type": "integer" },
|
|
195
|
+
"statements_reset_max": { "type": "integer" },
|
|
196
|
+
"statements_reset_at": { "type": "string" },
|
|
197
|
+
"statements_wal_fpi": { "type": "number" },
|
|
198
|
+
"statements_wal_records": { "type": "number" }
|
|
82
199
|
}
|
|
83
200
|
},
|
|
84
201
|
"dbEntry": {
|
|
@@ -101,10 +218,61 @@
|
|
|
101
218
|
"required": ["data"],
|
|
102
219
|
"properties": {
|
|
103
220
|
"data": { "$ref": "#/$defs/data" },
|
|
104
|
-
"postgres_version": { "$ref": "#/$defs/postgresVersion" }
|
|
221
|
+
"postgres_version": { "$ref": "#/$defs/postgresVersion" },
|
|
222
|
+
"window_start": { "type": "string" },
|
|
223
|
+
"window_end": { "type": "string" },
|
|
224
|
+
"wal": { "$ref": "#/$defs/counterHours" },
|
|
225
|
+
"wal_error": { "type": "string" },
|
|
226
|
+
"database_sizes": { "type": "object", "additionalProperties": { "$ref": "#/$defs/gaugeEnds" } },
|
|
227
|
+
"database_sizes_error": { "type": "string" },
|
|
228
|
+
"checkpoints": {
|
|
229
|
+
"type": "object",
|
|
230
|
+
"additionalProperties": false,
|
|
231
|
+
"properties": { "timed": { "$ref": "#/$defs/counterHours" }, "requested": { "$ref": "#/$defs/counterHours" } }
|
|
232
|
+
},
|
|
233
|
+
"checkpoints_timed_error": { "type": "string" },
|
|
234
|
+
"checkpoints_requested_error": { "type": "string" },
|
|
235
|
+
"archiver": {
|
|
236
|
+
"type": "object",
|
|
237
|
+
"additionalProperties": false,
|
|
238
|
+
"properties": {
|
|
239
|
+
"segment_bytes": { "type": "integer" },
|
|
240
|
+
"archived": { "$ref": "#/$defs/counterHours" },
|
|
241
|
+
"failed": { "$ref": "#/$defs/counterHours" },
|
|
242
|
+
"longest_gap_s": { "type": "number" },
|
|
243
|
+
"longest_gap_at": { "type": "string" }
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
"archiver_error": { "type": "string" },
|
|
247
|
+
"archiver_failed_error": { "type": "string" },
|
|
248
|
+
"archiver_gap_error": { "type": "string" },
|
|
249
|
+
"pg_wal": {
|
|
250
|
+
"type": "object",
|
|
251
|
+
"additionalProperties": false,
|
|
252
|
+
"required": ["max", "max_at", "last"],
|
|
253
|
+
"properties": { "max": { "type": "number" }, "max_at": { "type": "string" }, "last": { "type": "number" } }
|
|
254
|
+
},
|
|
255
|
+
"pg_wal_error": { "type": "string" },
|
|
256
|
+
"wal_waits": {
|
|
257
|
+
"type": "object",
|
|
258
|
+
"additionalProperties": false,
|
|
259
|
+
"required": ["wal_samples", "all_samples", "wal_events"],
|
|
260
|
+
"properties": {
|
|
261
|
+
"wal_samples": { "type": "number" },
|
|
262
|
+
"all_samples": { "type": "number" },
|
|
263
|
+
"wal_events": { "type": "object", "additionalProperties": { "type": "number" } }
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
"wal_waits_error": { "type": "string" },
|
|
267
|
+
"tables": { "type": "array", "items": { "$ref": "#/$defs/table" } },
|
|
268
|
+
"tables_error": { "type": "string" },
|
|
269
|
+
"settings": { "type": "object", "additionalProperties": { "$ref": "#/$defs/setting" } },
|
|
270
|
+
"settings_error": { "type": "string" },
|
|
271
|
+
"slots": { "type": "array", "items": { "$ref": "#/$defs/slot" } },
|
|
272
|
+
"slots_error": { "type": "string" },
|
|
273
|
+
"indexes_error": { "type": "string" },
|
|
274
|
+
"node_error": { "type": "string" }
|
|
105
275
|
}
|
|
106
276
|
}
|
|
107
277
|
}
|
|
108
278
|
}
|
|
109
|
-
|
|
110
|
-
|
package/sql/06.helpers.sql
CHANGED
|
@@ -231,7 +231,8 @@ begin
|
|
|
231
231
|
pg_get_constraintdef(oid, true) as condef
|
|
232
232
|
from pg_constraint
|
|
233
233
|
where conrelid = v_oid
|
|
234
|
-
|
|
234
|
+
-- p: shown with the indexes; n (PG18+): Columns already says NOT NULL
|
|
235
|
+
and contype not in ('p', 'n')
|
|
235
236
|
order by
|
|
236
237
|
case contype when 'f' then 1 when 'u' then 2 when 'c' then 3 else 4 end,
|
|
237
238
|
conname
|