@checkstack/healthcheck-postgres-backend 0.1.0 → 0.1.2
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/CHANGELOG.md +32 -0
- package/package.json +1 -1
- package/src/query-collector.ts +3 -2
- package/src/strategy.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @checkstack/healthcheck-postgres-backend
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f533141: Enforce health result factory function usage via branded types
|
|
8
|
+
|
|
9
|
+
- Added `healthResultSchema()` builder that enforces the use of factory functions at compile-time
|
|
10
|
+
- Added `healthResultArray()` factory for array fields (e.g., DNS resolved values)
|
|
11
|
+
- Added branded `HealthResultField<T>` type to mark schemas created by factory functions
|
|
12
|
+
- Consolidated `ChartType` and `HealthResultMeta` into `@checkstack/common` as single source of truth
|
|
13
|
+
- Updated all 12 health check strategies and 11 collectors to use `healthResultSchema()`
|
|
14
|
+
- Using raw `z.number()` etc. inside `healthResultSchema()` now causes a TypeScript error
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [9faec1f]
|
|
17
|
+
- Updated dependencies [827b286]
|
|
18
|
+
- Updated dependencies [f533141]
|
|
19
|
+
- Updated dependencies [aa4a8ab]
|
|
20
|
+
- @checkstack/backend-api@0.3.0
|
|
21
|
+
- @checkstack/common@0.2.0
|
|
22
|
+
- @checkstack/healthcheck-common@0.3.0
|
|
23
|
+
|
|
24
|
+
## 0.1.1
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies [97c5a6b]
|
|
29
|
+
- Updated dependencies [8e43507]
|
|
30
|
+
- Updated dependencies [97c5a6b]
|
|
31
|
+
- @checkstack/backend-api@0.2.0
|
|
32
|
+
- @checkstack/common@0.1.0
|
|
33
|
+
- @checkstack/healthcheck-common@0.2.0
|
|
34
|
+
|
|
3
35
|
## 0.1.0
|
|
4
36
|
|
|
5
37
|
### Minor Changes
|
package/package.json
CHANGED
package/src/query-collector.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
healthResultNumber,
|
|
10
10
|
healthResultBoolean,
|
|
11
|
+
healthResultSchema,
|
|
11
12
|
} from "@checkstack/healthcheck-common";
|
|
12
13
|
import { pluginMetadata } from "./plugin-metadata";
|
|
13
14
|
import type { PostgresTransportClient } from "./transport-client";
|
|
@@ -26,7 +27,7 @@ export type QueryConfig = z.infer<typeof queryConfigSchema>;
|
|
|
26
27
|
// RESULT SCHEMAS
|
|
27
28
|
// ============================================================================
|
|
28
29
|
|
|
29
|
-
const queryResultSchema =
|
|
30
|
+
const queryResultSchema = healthResultSchema({
|
|
30
31
|
rowCount: healthResultNumber({
|
|
31
32
|
"x-chart-type": "counter",
|
|
32
33
|
"x-chart-label": "Row Count",
|
|
@@ -44,7 +45,7 @@ const queryResultSchema = z.object({
|
|
|
44
45
|
|
|
45
46
|
export type QueryResult = z.infer<typeof queryResultSchema>;
|
|
46
47
|
|
|
47
|
-
const queryAggregatedSchema =
|
|
48
|
+
const queryAggregatedSchema = healthResultSchema({
|
|
48
49
|
avgExecutionTimeMs: healthResultNumber({
|
|
49
50
|
"x-chart-type": "line",
|
|
50
51
|
"x-chart-label": "Avg Execution Time",
|
package/src/strategy.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
healthResultBoolean,
|
|
14
14
|
healthResultNumber,
|
|
15
15
|
healthResultString,
|
|
16
|
+
healthResultSchema,
|
|
16
17
|
} from "@checkstack/healthcheck-common";
|
|
17
18
|
import type {
|
|
18
19
|
PostgresTransportClient,
|
|
@@ -51,7 +52,7 @@ export type PostgresConfigInput = z.input<typeof postgresConfigSchema>;
|
|
|
51
52
|
/**
|
|
52
53
|
* Per-run result metadata.
|
|
53
54
|
*/
|
|
54
|
-
const postgresResultSchema =
|
|
55
|
+
const postgresResultSchema = healthResultSchema({
|
|
55
56
|
connected: healthResultBoolean({
|
|
56
57
|
"x-chart-type": "boolean",
|
|
57
58
|
"x-chart-label": "Connected",
|
|
@@ -72,7 +73,7 @@ type PostgresResult = z.infer<typeof postgresResultSchema>;
|
|
|
72
73
|
/**
|
|
73
74
|
* Aggregated metadata for buckets.
|
|
74
75
|
*/
|
|
75
|
-
const postgresAggregatedSchema =
|
|
76
|
+
const postgresAggregatedSchema = healthResultSchema({
|
|
76
77
|
avgConnectionTime: healthResultNumber({
|
|
77
78
|
"x-chart-type": "line",
|
|
78
79
|
"x-chart-label": "Avg Connection Time",
|