@mastra/clickhouse 0.3.2-alpha.1 → 0.3.2-alpha.4
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +26 -0
- package/dist/_tsup-dts-rollup.d.cts +3 -1
- package/dist/_tsup-dts-rollup.d.ts +3 -1
- package/dist/index.cjs +11 -1
- package/dist/index.js +11 -1
- package/package.json +2 -2
- package/src/storage/index.ts +14 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/clickhouse@0.3.2-alpha.
|
|
2
|
+
> @mastra/clickhouse@0.3.2-alpha.4 build /home/runner/work/mastra/mastra/stores/clickhouse
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.4.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 8518ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/clickhouse/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/clickhouse/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 11394ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
|
-
[32mCJS[39m [1mdist/index.cjs [22m[
|
|
21
|
-
[32mCJS[39m ⚡️ Build success in
|
|
22
|
-
[32mESM[39m [1mdist/index.js [22m[32m27.
|
|
23
|
-
[32mESM[39m ⚡️ Build success in
|
|
20
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m28.07 KB[39m
|
|
21
|
+
[32mCJS[39m ⚡️ Build success in 998ms
|
|
22
|
+
[32mESM[39m [1mdist/index.js [22m[32m27.82 KB[39m
|
|
23
|
+
[32mESM[39m ⚡️ Build success in 1004ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
# @mastra/clickhouse
|
|
2
2
|
|
|
3
|
+
## 0.3.2-alpha.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [ccef9f9]
|
|
8
|
+
- Updated dependencies [51e6923]
|
|
9
|
+
- @mastra/core@0.9.2-alpha.4
|
|
10
|
+
|
|
11
|
+
## 0.3.2-alpha.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 4155f47: Add parameters to filter workflow runs
|
|
16
|
+
Add fromDate and toDate to telemetry parameters
|
|
17
|
+
- Updated dependencies [967b41c]
|
|
18
|
+
- Updated dependencies [4155f47]
|
|
19
|
+
- Updated dependencies [17826a9]
|
|
20
|
+
- @mastra/core@0.9.2-alpha.3
|
|
21
|
+
|
|
22
|
+
## 0.3.2-alpha.2
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [26738f4]
|
|
27
|
+
- @mastra/core@0.9.2-alpha.2
|
|
28
|
+
|
|
3
29
|
## 0.3.2-alpha.1
|
|
4
30
|
|
|
5
31
|
### Patch Changes
|
|
@@ -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.3.2-alpha.
|
|
3
|
+
"version": "0.3.2-alpha.4",
|
|
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.9.2-alpha.
|
|
24
|
+
"@mastra/core": "^0.9.2-alpha.4"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@microsoft/api-extractor": "^7.52.5",
|
package/src/storage/index.ts
CHANGED
|
@@ -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({
|