@mastra/clickhouse 1.25.1-alpha.1 → 1.25.1-alpha.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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-storage-retention.md +15 -12
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/observability/v-next/trace-aggregate.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/docs/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: mastra-clickhouse
|
|
|
3
3
|
description: Documentation for @mastra/clickhouse. Use when working with @mastra/clickhouse APIs, configuration, or implementation.
|
|
4
4
|
metadata:
|
|
5
5
|
package: "@mastra/clickhouse"
|
|
6
|
-
version: "1.25.1-alpha.
|
|
6
|
+
version: "1.25.1-alpha.2"
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
## When to use
|
|
@@ -12,18 +12,21 @@ Retention covers **growth tables** only: tables that accumulate rows unbounded a
|
|
|
12
12
|
|
|
13
13
|
Storage adapters use the shared core retention contract for `prune()`, or a database-native mechanism when that better matches the backend.
|
|
14
14
|
|
|
15
|
-
| Adapter
|
|
16
|
-
|
|
|
17
|
-
| libSQL
|
|
18
|
-
| PostgreSQL
|
|
19
|
-
| MongoDB
|
|
20
|
-
| DuckDB
|
|
21
|
-
| MySQL
|
|
22
|
-
| Microsoft SQL Server
|
|
23
|
-
| Oracle Database
|
|
24
|
-
| Amazon Aurora DSQL
|
|
25
|
-
| Google Cloud Spanner
|
|
26
|
-
|
|
|
15
|
+
| Adapter | Mechanism | Retention support |
|
|
16
|
+
| --------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
17
|
+
| libSQL | `prune()` | All supported growth domains |
|
|
18
|
+
| PostgreSQL | `prune()` | All supported growth domains. vNext observability drops expired partitions or chunks |
|
|
19
|
+
| MongoDB | `prune()` or native TTL | All supported growth domains. Native TTL indexes are also available |
|
|
20
|
+
| DuckDB | `prune()` | Observability spans, metrics, logs, scores, and feedback |
|
|
21
|
+
| MySQL | `prune()` | Observability spans, durable agent run fencing (`runOwnership`, `runFences`) |
|
|
22
|
+
| Microsoft SQL Server | `prune()` | Observability spans, durable agent run fencing (`runOwnership`, `runFences`) |
|
|
23
|
+
| Oracle Database | `prune()` | Observability spans and logs, durable agent run fencing (`runOwnership`, `runFences`) |
|
|
24
|
+
| Amazon Aurora DSQL | `prune()` | Observability spans, durable agent run fencing (`runOwnership`, `runFences`) |
|
|
25
|
+
| Google Cloud Spanner | `prune()` | Observability spans, plus metrics when metrics storage is enabled. Durable agent run fencing (`runOwnership`, `runFences`) |
|
|
26
|
+
| DynamoDB | `prune()` | Durable agent run fencing (`runOwnership`, `runFences`) |
|
|
27
|
+
| Convex | `prune()` | Durable agent run fencing (`runOwnership`, `runFences`). Redeploy your Convex functions after upgrading |
|
|
28
|
+
| Cloudflare D1 and Durable Objects | `prune()` | Durable agent run fencing (`runOwnership`, `runFences`) |
|
|
29
|
+
| ClickHouse | Native TTL | Observability spans, metrics, logs, scores, and feedback. When all five signals have finite retention, deletion-request records expire after the longest signal retention plus 30 days |
|
|
27
30
|
|
|
28
31
|
## Storage-specific maintenance
|
|
29
32
|
|
package/dist/index.cjs
CHANGED
|
@@ -8109,7 +8109,13 @@ const COMPARISON_SQL = {
|
|
|
8109
8109
|
*/
|
|
8110
8110
|
function compileClickHouseTraceAggregate(plan) {
|
|
8111
8111
|
const parameters = new ParameterBuilder();
|
|
8112
|
-
const ctes = compileClickHouseTraceCandidates(plan, "*", parameters);
|
|
8112
|
+
const ctes = compileClickHouseTraceCandidates(plan, "*", parameters, { oneRootPerTrace: true });
|
|
8113
|
+
ctes.push(`trace_roots AS (
|
|
8114
|
+
SELECT *
|
|
8115
|
+
FROM candidates
|
|
8116
|
+
ORDER BY traceId, dedupeKey
|
|
8117
|
+
LIMIT 1 BY traceId
|
|
8118
|
+
)`);
|
|
8113
8119
|
const dimensionSql = (field) => {
|
|
8114
8120
|
if (field.startsWith("metadata.")) return traceMetadataValueSql(parameters.add(field.slice(9), "String"));
|
|
8115
8121
|
const sql = Object.hasOwn(DIMENSION_SQL, field) ? DIMENSION_SQL[field] : void 0;
|
|
@@ -8143,7 +8149,7 @@ function compileClickHouseTraceAggregate(plan) {
|
|
|
8143
8149
|
}
|
|
8144
8150
|
ctes.push(`facts AS (
|
|
8145
8151
|
SELECT ${factColumns.join(",\n ")}
|
|
8146
|
-
FROM
|
|
8152
|
+
FROM trace_roots r${usageJoin}
|
|
8147
8153
|
)`);
|
|
8148
8154
|
const mixedUnitsSql = "minOrNull(unitMin) != maxOrNull(unitMax)";
|
|
8149
8155
|
const measureSql = (name) => {
|