postgresai 0.19.0-rc.2 → 0.19.0-rc.3
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 +7 -4
- package/package.json +1 -1
- package/schemas/K003.schema.json +73 -3
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.3",
|
|
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.3";
|
|
16902
16902
|
var package_default2 = {
|
|
16903
16903
|
name: "postgresai",
|
|
16904
16904
|
version,
|
|
@@ -44429,8 +44429,11 @@ select (count(*) filter (where auth_method = 'cert'))::int as cert,
|
|
|
44429
44429
|
from pg_hba_file_rules
|
|
44430
44430
|
`;
|
|
44431
44431
|
function a005Error(err) {
|
|
44432
|
-
const
|
|
44433
|
-
|
|
44432
|
+
const chars = Array.from((err instanceof Error ? err.message : String(err)).replace(/\s+/g, " ").trim());
|
|
44433
|
+
if (chars.length <= A005_ERROR_CHARS)
|
|
44434
|
+
return chars.join("") || "unknown error";
|
|
44435
|
+
const head = Math.floor((A005_ERROR_CHARS - 3) / 3);
|
|
44436
|
+
return chars.slice(0, head).join("") + "..." + chars.slice(chars.length - (A005_ERROR_CHARS - 3 - head)).join("");
|
|
44434
44437
|
}
|
|
44435
44438
|
var a005OpenDatabase = async (client, database) => {
|
|
44436
44439
|
const params = client.connectionParameters;
|
package/package.json
CHANGED
package/schemas/K003.schema.json
CHANGED
|
@@ -144,9 +144,81 @@
|
|
|
144
144
|
"summary": { "$ref": "#/$defs/summary" }
|
|
145
145
|
}
|
|
146
146
|
},
|
|
147
|
+
"hourlyNumbers": { "type": "array", "items": { "type": "number" } },
|
|
148
|
+
"hourlyQueryEntry": {
|
|
149
|
+
"type": "object",
|
|
150
|
+
"additionalProperties": false,
|
|
151
|
+
"required": ["queryid", "total_time_ms", "total_exec_time_ms", "total_plan_time_ms", "hourly_time_ms", "hourly_exec_time_ms", "hourly_plan_time_ms"],
|
|
152
|
+
"properties": {
|
|
153
|
+
"queryid": { "type": "string" },
|
|
154
|
+
"total_time_ms": { "type": "number" },
|
|
155
|
+
"total_exec_time_ms": { "type": "number" },
|
|
156
|
+
"total_plan_time_ms": { "type": "number" },
|
|
157
|
+
"hourly_time_ms": { "$ref": "#/$defs/hourlyNumbers" },
|
|
158
|
+
"hourly_exec_time_ms": { "$ref": "#/$defs/hourlyNumbers" },
|
|
159
|
+
"hourly_plan_time_ms": { "type": ["array", "null"], "items": { "type": "number" } },
|
|
160
|
+
"calls": { "type": "number" },
|
|
161
|
+
"rows": { "type": "number" },
|
|
162
|
+
"shared_blks_hit_bytes": { "type": "number" },
|
|
163
|
+
"shared_blks_read_bytes": { "type": "number" },
|
|
164
|
+
"wal_bytes": { "type": "number" },
|
|
165
|
+
"temp_bytes_written": { "type": "number" },
|
|
166
|
+
"query_text": { "type": "string" },
|
|
167
|
+
"is_monitoring": { "type": "boolean" },
|
|
168
|
+
"relations": { "type": "array", "items": { "type": "string" }, "maxItems": 3 }
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"exportRule": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"additionalProperties": false,
|
|
174
|
+
"required": ["top_n_per_database", "ranked_by", "min_calls", "min_exec_time_ms", "interval_seconds"],
|
|
175
|
+
"properties": {
|
|
176
|
+
"top_n_per_database": { "type": "integer" },
|
|
177
|
+
"ranked_by": { "type": "string" },
|
|
178
|
+
"min_calls": { "type": "integer" },
|
|
179
|
+
"min_exec_time_ms": { "type": "number" },
|
|
180
|
+
"interval_seconds": { "type": "integer" }
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"hourlySummary": {
|
|
184
|
+
"type": "object",
|
|
185
|
+
"additionalProperties": false,
|
|
186
|
+
"required": ["queries_returned", "total_time_ms", "total_time_tracked_queries_ms", "total_time_other_ms", "time_range_hours", "hourly_timestamps", "limit", "plan_time_available", "note"],
|
|
187
|
+
"properties": {
|
|
188
|
+
"queries_returned": { "type": "integer" },
|
|
189
|
+
"total_time_ms": { "type": "number" },
|
|
190
|
+
"total_time_tracked_queries_ms": { "type": "number" },
|
|
191
|
+
"total_time_other_ms": { "type": "number" },
|
|
192
|
+
"time_range_hours": { "type": "integer" },
|
|
193
|
+
"hourly_timestamps": { "type": "array", "items": { "type": "integer" } },
|
|
194
|
+
"limit": { "type": "integer" },
|
|
195
|
+
"plan_time_available": { "type": "boolean" },
|
|
196
|
+
"note": { "type": "string" },
|
|
197
|
+
"window_start": { "type": "string" },
|
|
198
|
+
"window_end": { "type": "string" },
|
|
199
|
+
"window_seconds": { "type": "integer" },
|
|
200
|
+
"export_rule": { "$ref": "#/$defs/exportRule" },
|
|
201
|
+
"total_calls": { "type": "number" },
|
|
202
|
+
"statements_exported_max": { "type": "integer" },
|
|
203
|
+
"statements_reset_max": { "type": "integer" },
|
|
204
|
+
"statements_reset_at": { "type": "string" }
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
"hourlyDbEntry": {
|
|
208
|
+
"type": "object",
|
|
209
|
+
"additionalProperties": false,
|
|
210
|
+
"required": ["top_queries", "other_time_hourly", "other_exec_time_hourly", "other_plan_time_hourly", "summary"],
|
|
211
|
+
"properties": {
|
|
212
|
+
"top_queries": { "type": "array", "items": { "$ref": "#/$defs/hourlyQueryEntry" } },
|
|
213
|
+
"other_time_hourly": { "$ref": "#/$defs/hourlyNumbers" },
|
|
214
|
+
"other_exec_time_hourly": { "$ref": "#/$defs/hourlyNumbers" },
|
|
215
|
+
"other_plan_time_hourly": { "type": ["array", "null"], "items": { "type": "number" } },
|
|
216
|
+
"summary": { "$ref": "#/$defs/hourlySummary" }
|
|
217
|
+
}
|
|
218
|
+
},
|
|
147
219
|
"data": {
|
|
148
220
|
"type": "object",
|
|
149
|
-
"additionalProperties": { "$ref": "#/$defs/dbEntry" }
|
|
221
|
+
"additionalProperties": { "anyOf": [{ "$ref": "#/$defs/hourlyDbEntry" }, { "$ref": "#/$defs/dbEntry" }] }
|
|
150
222
|
},
|
|
151
223
|
"nodeResult": {
|
|
152
224
|
"type": "object",
|
|
@@ -159,5 +231,3 @@
|
|
|
159
231
|
}
|
|
160
232
|
}
|
|
161
233
|
}
|
|
162
|
-
|
|
163
|
-
|