@mastra/clickhouse 1.21.1 → 1.22.0-alpha.1

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.
@@ -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.21.1"
6
+ version: "1.22.0-alpha.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.21.1",
2
+ "version": "1.22.0-alpha.1",
3
3
  "package": "@mastra/clickhouse",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -202,7 +202,7 @@ async function retentionTick() {
202
202
  }
203
203
  ```
204
204
 
205
- You can also cancel a long-running prune with an `AbortSignal`: the loop stops between batches and returns partial results with `done: false`, so the next run resumes cleanly.
205
+ You can also cancel a long-running prune with an `AbortSignal`: the loop stops between batches and returns partial results with `done: false`. The next run resumes cleanly.
206
206
 
207
207
  ## ClickHouse native TTL
208
208
 
package/dist/index.cjs CHANGED
@@ -6590,6 +6590,22 @@ const TRACE_FIELDS = {
6590
6590
  sql: "r.resourceId",
6591
6591
  parameterType: "String"
6592
6592
  },
6593
+ runId: {
6594
+ sql: "r.runId",
6595
+ parameterType: "String"
6596
+ },
6597
+ sessionId: {
6598
+ sql: "r.sessionId",
6599
+ parameterType: "String"
6600
+ },
6601
+ userId: {
6602
+ sql: "r.userId",
6603
+ parameterType: "String"
6604
+ },
6605
+ organizationId: {
6606
+ sql: "r.organizationId",
6607
+ parameterType: "String"
6608
+ },
6593
6609
  startedAt: {
6594
6610
  sql: "r.startedAt",
6595
6611
  parameterType: "DateTime64(3, 'UTC')"
@@ -6683,6 +6699,22 @@ const SPAN_FIELDS = {
6683
6699
  rootEntityVersionId: {
6684
6700
  sql: "s.rootEntityVersionId",
6685
6701
  parameterType: "String"
6702
+ },
6703
+ runId: {
6704
+ sql: "s.runId",
6705
+ parameterType: "String"
6706
+ },
6707
+ sessionId: {
6708
+ sql: "s.sessionId",
6709
+ parameterType: "String"
6710
+ },
6711
+ userId: {
6712
+ sql: "s.userId",
6713
+ parameterType: "String"
6714
+ },
6715
+ organizationId: {
6716
+ sql: "s.organizationId",
6717
+ parameterType: "String"
6686
6718
  }
6687
6719
  };
6688
6720
  const SCORE_FIELDS = {
@@ -6906,6 +6938,12 @@ function compileClickHouseTraceScope(selection, relationCollections, parameters,
6906
6938
  SELECT * FROM (
6907
6939
  SELECT *
6908
6940
  FROM ${TABLE_TRACE_ROOTS}
6941
+ WHERE traceId IN (
6942
+ SELECT traceId
6943
+ FROM ${TABLE_TRACE_ROOTS}
6944
+ WHERE startedAt >= ${from}
6945
+ AND startedAt < ${to}${tenant}
6946
+ )
6909
6947
  ORDER BY dedupeKey
6910
6948
  LIMIT 1 BY dedupeKey
6911
6949
  )
@@ -6934,7 +6972,11 @@ function compileClickHouseTraceScope(selection, relationCollections, parameters,
6934
6972
  entityName,
6935
6973
  entityVersionId,
6936
6974
  parentEntityVersionId,
6937
- rootEntityVersionId
6975
+ rootEntityVersionId,
6976
+ runId,
6977
+ sessionId,
6978
+ userId,
6979
+ organizationId
6938
6980
  FROM ${TABLE_SPAN_EVENTS}
6939
6981
  WHERE isNotNull(traceId)
6940
6982
  AND traceId IN (SELECT traceId FROM root_scope)${tenant}
@@ -8644,7 +8686,8 @@ var ObservabilityStorageClickhouseVNext = class extends _mastra_core_storage.Obs
8644
8686
  "trace-query-discovery",
8645
8687
  "thread-query",
8646
8688
  "trace-query-tenant-scope",
8647
- "feedback"
8689
+ "feedback",
8690
+ "trace-query-context-ids"
8648
8691
  ];
8649
8692
  return [
8650
8693
  "metrics",
@@ -8661,7 +8704,8 @@ var ObservabilityStorageClickhouseVNext = class extends _mastra_core_storage.Obs
8661
8704
  "trace-query-discovery",
8662
8705
  "thread-query",
8663
8706
  "trace-query-tenant-scope",
8664
- "feedback"
8707
+ "feedback",
8708
+ "trace-query-context-ids"
8665
8709
  ];
8666
8710
  }
8667
8711
  async createSpan(args) {