@mastra/clickhouse 0.3.0-alpha.5 → 0.3.0-alpha.6

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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/clickhouse@0.3.0-alpha.5 build /home/runner/work/mastra/mastra/stores/clickhouse
2
+ > @mastra/clickhouse@0.3.0-alpha.6 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
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.4.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 9273ms
9
+ TSC ⚡️ Build success in 8944ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.2
13
13
  Writing package typings: /home/runner/work/mastra/mastra/stores/clickhouse/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.2
15
15
  Writing package typings: /home/runner/work/mastra/mastra/stores/clickhouse/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 10930ms
16
+ DTS ⚡️ Build success in 10363ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- ESM dist/index.js 25.48 KB
21
- ESM ⚡️ Build success in 741ms
22
- CJS dist/index.cjs 25.65 KB
23
- CJS ⚡️ Build success in 741ms
20
+ CJS dist/index.cjs 25.72 KB
21
+ CJS ⚡️ Build success in 996ms
22
+ ESM dist/index.js 25.51 KB
23
+ ESM ⚡️ Build success in 998ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @mastra/clickhouse
2
2
 
3
+ ## 0.3.0-alpha.6
4
+
5
+ ### Patch Changes
6
+
7
+ - dd8d0cb: make Clickhouse storage extendable
8
+ - Updated dependencies [157c741]
9
+ - @mastra/core@0.9.0-alpha.6
10
+
3
11
  ## 0.3.0-alpha.5
4
12
 
5
13
  ### Patch Changes
@@ -1,3 +1,4 @@
1
+ import type { ClickHouseClient } from '@clickhouse/client';
1
2
  import type { EvalRow } from '@mastra/core/storage';
2
3
  import { MastraStorage } from '@mastra/core/storage';
3
4
  import type { MessageType } from '@mastra/core/memory';
@@ -33,8 +34,8 @@ export { ClickhouseConfig }
33
34
  export { ClickhouseConfig as ClickhouseConfig_alias_1 }
34
35
 
35
36
  declare class ClickhouseStore extends MastraStorage {
36
- private db;
37
- private ttl;
37
+ protected db: ClickHouseClient;
38
+ protected ttl: ClickhouseConfig['ttl'];
38
39
  constructor(config: ClickhouseConfig);
39
40
  private transformEvalRow;
40
41
  getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
@@ -122,6 +123,14 @@ declare class ClickhouseStore extends MastraStorage {
122
123
  export { ClickhouseStore }
123
124
  export { ClickhouseStore as ClickhouseStore_alias_1 }
124
125
 
126
+ declare const COLUMN_TYPES: Record<StorageColumn['type'], string>;
127
+ export { COLUMN_TYPES }
128
+ export { COLUMN_TYPES as COLUMN_TYPES_alias_1 }
129
+
125
130
  declare type IntervalUnit = 'NANOSECOND' | 'MICROSECOND' | 'MILLISECOND' | 'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR';
126
131
 
132
+ declare const TABLE_ENGINES: Record<TABLE_NAMES, string>;
133
+ export { TABLE_ENGINES }
134
+ export { TABLE_ENGINES as TABLE_ENGINES_alias_1 }
135
+
127
136
  export { }
@@ -1,3 +1,4 @@
1
+ import type { ClickHouseClient } from '@clickhouse/client';
1
2
  import type { EvalRow } from '@mastra/core/storage';
2
3
  import { MastraStorage } from '@mastra/core/storage';
3
4
  import type { MessageType } from '@mastra/core/memory';
@@ -33,8 +34,8 @@ export { ClickhouseConfig }
33
34
  export { ClickhouseConfig as ClickhouseConfig_alias_1 }
34
35
 
35
36
  declare class ClickhouseStore extends MastraStorage {
36
- private db;
37
- private ttl;
37
+ protected db: ClickHouseClient;
38
+ protected ttl: ClickhouseConfig['ttl'];
38
39
  constructor(config: ClickhouseConfig);
39
40
  private transformEvalRow;
40
41
  getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
@@ -122,6 +123,14 @@ declare class ClickhouseStore extends MastraStorage {
122
123
  export { ClickhouseStore }
123
124
  export { ClickhouseStore as ClickhouseStore_alias_1 }
124
125
 
126
+ declare const COLUMN_TYPES: Record<StorageColumn['type'], string>;
127
+ export { COLUMN_TYPES }
128
+ export { COLUMN_TYPES as COLUMN_TYPES_alias_1 }
129
+
125
130
  declare type IntervalUnit = 'NANOSECOND' | 'MICROSECOND' | 'MILLISECOND' | 'SECOND' | 'MINUTE' | 'HOUR' | 'DAY' | 'WEEK' | 'MONTH' | 'QUARTER' | 'YEAR';
126
131
 
132
+ declare const TABLE_ENGINES: Record<TABLE_NAMES, string>;
133
+ export { TABLE_ENGINES }
134
+ export { TABLE_ENGINES as TABLE_ENGINES_alias_1 }
135
+
127
136
  export { }
package/dist/index.cjs CHANGED
@@ -778,4 +778,6 @@ var ClickhouseStore = class extends storage.MastraStorage {
778
778
  }
779
779
  };
780
780
 
781
+ exports.COLUMN_TYPES = COLUMN_TYPES;
781
782
  exports.ClickhouseStore = ClickhouseStore;
783
+ exports.TABLE_ENGINES = TABLE_ENGINES;
package/dist/index.d.cts CHANGED
@@ -1,2 +1,4 @@
1
1
  export { ClickhouseConfig } from './_tsup-dts-rollup.cjs';
2
+ export { TABLE_ENGINES } from './_tsup-dts-rollup.cjs';
3
+ export { COLUMN_TYPES } from './_tsup-dts-rollup.cjs';
2
4
  export { ClickhouseStore } from './_tsup-dts-rollup.cjs';
package/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
1
  export { ClickhouseConfig } from './_tsup-dts-rollup.js';
2
+ export { TABLE_ENGINES } from './_tsup-dts-rollup.js';
3
+ export { COLUMN_TYPES } from './_tsup-dts-rollup.js';
2
4
  export { ClickhouseStore } from './_tsup-dts-rollup.js';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createClient } from '@clickhouse/client';
2
- import { MastraStorage, TABLE_EVALS, TABLE_SCHEMAS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT, TABLE_THREADS, TABLE_MESSAGES } from '@mastra/core/storage';
2
+ import { TABLE_EVALS, TABLE_THREADS, TABLE_TRACES, TABLE_WORKFLOW_SNAPSHOT, TABLE_MESSAGES, MastraStorage, TABLE_SCHEMAS } from '@mastra/core/storage';
3
3
 
4
4
  // src/storage/index.ts
5
5
  function safelyParseJSON(jsonString) {
@@ -776,4 +776,4 @@ var ClickhouseStore = class extends MastraStorage {
776
776
  }
777
777
  };
778
778
 
779
- export { ClickhouseStore };
779
+ export { COLUMN_TYPES, ClickhouseStore, TABLE_ENGINES };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/clickhouse",
3
- "version": "0.3.0-alpha.5",
3
+ "version": "0.3.0-alpha.6",
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.0-alpha.5"
24
+ "@mastra/core": "^0.9.0-alpha.6"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@microsoft/api-extractor": "^7.52.1",
@@ -53,7 +53,7 @@ export type ClickhouseConfig = {
53
53
  };
54
54
  };
55
55
 
56
- const TABLE_ENGINES: Record<TABLE_NAMES, string> = {
56
+ export const TABLE_ENGINES: Record<TABLE_NAMES, string> = {
57
57
  [TABLE_MESSAGES]: `MergeTree()`,
58
58
  [TABLE_WORKFLOW_SNAPSHOT]: `ReplacingMergeTree()`,
59
59
  [TABLE_TRACES]: `MergeTree()`,
@@ -61,7 +61,7 @@ const TABLE_ENGINES: Record<TABLE_NAMES, string> = {
61
61
  [TABLE_EVALS]: `MergeTree()`,
62
62
  };
63
63
 
64
- const COLUMN_TYPES: Record<StorageColumn['type'], string> = {
64
+ export const COLUMN_TYPES: Record<StorageColumn['type'], string> = {
65
65
  text: 'String',
66
66
  timestamp: 'DateTime64(3)',
67
67
  uuid: 'String',
@@ -89,8 +89,8 @@ function transformRow<R>(row: any): R {
89
89
  }
90
90
 
91
91
  export class ClickhouseStore extends MastraStorage {
92
- private db: ClickHouseClient;
93
- private ttl: ClickhouseConfig['ttl'] = {};
92
+ protected db: ClickHouseClient;
93
+ protected ttl: ClickhouseConfig['ttl'] = {};
94
94
 
95
95
  constructor(config: ClickhouseConfig) {
96
96
  super({ name: 'ClickhouseStore' });