@mastra/clickhouse 0.0.0-separate-trace-data-from-component-20250501141108 → 0.0.0-vnext-inngest-20250506121901

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 CHANGED
@@ -1,13 +1,55 @@
1
1
  # @mastra/clickhouse
2
2
 
3
- ## 0.0.0-separate-trace-data-from-component-20250501141108
3
+ ## 0.0.0-vnext-inngest-20250506121901
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - 4155f47: Add parameters to filter workflow runs
8
+ Add fromDate and toDate to telemetry parameters
9
+ - Updated dependencies [967b41c]
10
+ - Updated dependencies [3d2fb5c]
7
11
  - Updated dependencies [26738f4]
12
+ - Updated dependencies [4155f47]
13
+ - Updated dependencies [7eeb2bc]
8
14
  - Updated dependencies [b804723]
15
+ - Updated dependencies [8607972]
16
+ - Updated dependencies [ccef9f9]
9
17
  - Updated dependencies [0097d50]
10
- - @mastra/core@0.0.0-separate-trace-data-from-component-20250501141108
18
+ - Updated dependencies [7eeb2bc]
19
+ - Updated dependencies [17826a9]
20
+ - Updated dependencies [fba031f]
21
+ - Updated dependencies [51e6923]
22
+ - @mastra/core@0.0.0-vnext-inngest-20250506121901
23
+
24
+ ## 0.3.2-alpha.5
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [3d2fb5c]
29
+ - Updated dependencies [7eeb2bc]
30
+ - Updated dependencies [8607972]
31
+ - Updated dependencies [7eeb2bc]
32
+ - Updated dependencies [fba031f]
33
+ - @mastra/core@0.9.2-alpha.5
34
+
35
+ ## 0.3.2-alpha.4
36
+
37
+ ### Patch Changes
38
+
39
+ - Updated dependencies [ccef9f9]
40
+ - Updated dependencies [51e6923]
41
+ - @mastra/core@0.9.2-alpha.4
42
+
43
+ ## 0.3.2-alpha.3
44
+
45
+ ### Patch Changes
46
+
47
+ - 4155f47: Add parameters to filter workflow runs
48
+ Add fromDate and toDate to telemetry parameters
49
+ - Updated dependencies [967b41c]
50
+ - Updated dependencies [4155f47]
51
+ - Updated dependencies [17826a9]
52
+ - @mastra/core@0.9.2-alpha.3
11
53
 
12
54
  ## 0.3.2-alpha.2
13
55
 
@@ -45,13 +45,15 @@ declare class ClickhouseStore extends MastraStorage {
45
45
  tableName: TABLE_NAMES;
46
46
  records: Record<string, any>[];
47
47
  }): Promise<void>;
48
- getTraces({ name, scope, page, perPage, attributes, filters, }: {
48
+ getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }: {
49
49
  name?: string;
50
50
  scope?: string;
51
51
  page: number;
52
52
  perPage: number;
53
53
  attributes?: Record<string, string>;
54
54
  filters?: Record<string, any>;
55
+ fromDate?: Date;
56
+ toDate?: Date;
55
57
  }): Promise<any[]>;
56
58
  optimizeTable({ tableName }: {
57
59
  tableName: TABLE_NAMES;
@@ -45,13 +45,15 @@ declare class ClickhouseStore extends MastraStorage {
45
45
  tableName: TABLE_NAMES;
46
46
  records: Record<string, any>[];
47
47
  }): Promise<void>;
48
- getTraces({ name, scope, page, perPage, attributes, filters, }: {
48
+ getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }: {
49
49
  name?: string;
50
50
  scope?: string;
51
51
  page: number;
52
52
  perPage: number;
53
53
  attributes?: Record<string, string>;
54
54
  filters?: Record<string, any>;
55
+ fromDate?: Date;
56
+ toDate?: Date;
55
57
  }): Promise<any[]>;
56
58
  optimizeTable({ tableName }: {
57
59
  tableName: TABLE_NAMES;
package/dist/index.cjs CHANGED
@@ -138,7 +138,9 @@ var ClickhouseStore = class extends storage.MastraStorage {
138
138
  page,
139
139
  perPage,
140
140
  attributes,
141
- filters
141
+ filters,
142
+ fromDate,
143
+ toDate
142
144
  }) {
143
145
  const limit = perPage;
144
146
  const offset = page * perPage;
@@ -166,6 +168,14 @@ var ClickhouseStore = class extends storage.MastraStorage {
166
168
  args[`var_col_${key}`] = value;
167
169
  });
168
170
  }
171
+ if (fromDate) {
172
+ conditions.push(`createdAt >= {var_from_date:DateTime64(3)}`);
173
+ args.var_from_date = fromDate.getTime() / 1e3;
174
+ }
175
+ if (toDate) {
176
+ conditions.push(`createdAt <= {var_to_date:DateTime64(3)}`);
177
+ args.var_to_date = toDate.getTime() / 1e3;
178
+ }
169
179
  const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
170
180
  const result = await this.db.query({
171
181
  query: `SELECT *, toDateTime64(createdAt, 3) as createdAt FROM ${storage.TABLE_TRACES} ${whereClause} ORDER BY "createdAt" DESC LIMIT ${limit} OFFSET ${offset}`,
package/dist/index.js CHANGED
@@ -136,7 +136,9 @@ var ClickhouseStore = class extends MastraStorage {
136
136
  page,
137
137
  perPage,
138
138
  attributes,
139
- filters
139
+ filters,
140
+ fromDate,
141
+ toDate
140
142
  }) {
141
143
  const limit = perPage;
142
144
  const offset = page * perPage;
@@ -164,6 +166,14 @@ var ClickhouseStore = class extends MastraStorage {
164
166
  args[`var_col_${key}`] = value;
165
167
  });
166
168
  }
169
+ if (fromDate) {
170
+ conditions.push(`createdAt >= {var_from_date:DateTime64(3)}`);
171
+ args.var_from_date = fromDate.getTime() / 1e3;
172
+ }
173
+ if (toDate) {
174
+ conditions.push(`createdAt <= {var_to_date:DateTime64(3)}`);
175
+ args.var_to_date = toDate.getTime() / 1e3;
176
+ }
167
177
  const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
168
178
  const result = await this.db.query({
169
179
  query: `SELECT *, toDateTime64(createdAt, 3) as createdAt FROM ${TABLE_TRACES} ${whereClause} ORDER BY "createdAt" DESC LIMIT ${limit} OFFSET ${offset}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/clickhouse",
3
- "version": "0.0.0-separate-trace-data-from-component-20250501141108",
3
+ "version": "0.0.0-vnext-inngest-20250506121901",
4
4
  "description": "Clickhouse provider for Mastra - includes db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -21,7 +21,7 @@
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
23
  "@clickhouse/client": "^1.11.0",
24
- "@mastra/core": "0.0.0-separate-trace-data-from-component-20250501141108"
24
+ "@mastra/core": "0.0.0-vnext-inngest-20250506121901"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@microsoft/api-extractor": "^7.52.5",
@@ -30,7 +30,7 @@
30
30
  "tsup": "^8.4.0",
31
31
  "typescript": "^5.8.2",
32
32
  "vitest": "^3.1.2",
33
- "@internal/lint": "0.0.2"
33
+ "@internal/lint": "0.0.0-vnext-inngest-20250506121901"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
@@ -210,6 +210,8 @@ export class ClickhouseStore extends MastraStorage {
210
210
  perPage,
211
211
  attributes,
212
212
  filters,
213
+ fromDate,
214
+ toDate,
213
215
  }: {
214
216
  name?: string;
215
217
  scope?: string;
@@ -217,6 +219,8 @@ export class ClickhouseStore extends MastraStorage {
217
219
  perPage: number;
218
220
  attributes?: Record<string, string>;
219
221
  filters?: Record<string, any>;
222
+ fromDate?: Date;
223
+ toDate?: Date;
220
224
  }): Promise<any[]> {
221
225
  const limit = perPage;
222
226
  const offset = page * perPage;
@@ -248,6 +252,16 @@ export class ClickhouseStore extends MastraStorage {
248
252
  });
249
253
  }
250
254
 
255
+ if (fromDate) {
256
+ conditions.push(`createdAt >= {var_from_date:DateTime64(3)}`);
257
+ args.var_from_date = fromDate.getTime() / 1000; // Convert to Unix timestamp
258
+ }
259
+
260
+ if (toDate) {
261
+ conditions.push(`createdAt <= {var_to_date:DateTime64(3)}`);
262
+ args.var_to_date = toDate.getTime() / 1000; // Convert to Unix timestamp
263
+ }
264
+
251
265
  const whereClause = conditions.length > 0 ? `WHERE ${conditions.join(' AND ')}` : '';
252
266
 
253
267
  const result = await this.db.query({