@mastra/clickhouse 1.0.0-beta.9 → 1.0.0

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/README.md CHANGED
@@ -11,7 +11,7 @@ npm install @mastra/clickhouse
11
11
  ## Prerequisites
12
12
 
13
13
  - Clickhouse server (version 21.12 or higher recommended)
14
- - Node.js 16 or higher
14
+ - Node.js 22.13.0 or later
15
15
 
16
16
  ## Usage
17
17
 
@@ -28,4 +28,4 @@ docs/
28
28
  ## Version
29
29
 
30
30
  Package: @mastra/clickhouse
31
- Version: 1.0.0-beta.9
31
+ Version: 1.0.0
@@ -5,7 +5,7 @@ description: Documentation for @mastra/clickhouse. Includes links to type defini
5
5
 
6
6
  # @mastra/clickhouse Documentation
7
7
 
8
- > **Version**: 1.0.0-beta.9
8
+ > **Version**: 1.0.0
9
9
  > **Package**: @mastra/clickhouse
10
10
 
11
11
  ## Quick Navigation
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.0-beta.9",
2
+ "version": "1.0.0",
3
3
  "package": "@mastra/clickhouse",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -5,27 +5,27 @@
5
5
 
6
6
  ---
7
7
 
8
- ## Reference: Storage Composition
8
+ ## Reference: Composite Storage
9
9
 
10
10
  > Documentation for combining multiple storage backends in Mastra.
11
11
 
12
- MastraStorage can compose storage domains from different adapters. Use it when you need different databases for different purposes. For example, use LibSQL for memory and PostgreSQL for workflows.
12
+ `MastraCompositeStore` can compose storage domains from different providers. Use it when you need different databases for different purposes. For example, use LibSQL for memory and PostgreSQL for workflows.
13
13
 
14
14
  ## Installation
15
15
 
16
- MastraStorage is included in `@mastra/core`:
16
+ `MastraCompositeStore` is included in `@mastra/core`:
17
17
 
18
18
  ```bash
19
19
  npm install @mastra/core@beta
20
20
  ```
21
21
 
22
- You'll also need to install the storage adapters you want to compose:
22
+ You'll also need to install the storage providers you want to compose:
23
23
 
24
24
  ```bash
25
25
  npm install @mastra/pg@beta @mastra/libsql@beta
26
26
  ```
27
27
 
28
- ## Storage Domains
28
+ ## Storage domains
29
29
 
30
30
  Mastra organizes storage into five specialized domains, each handling a specific type of data. Each domain can be backed by a different storage adapter, and domain classes are exported from each storage package.
31
31
 
@@ -43,14 +43,14 @@ Mastra organizes storage into five specialized domains, each handling a specific
43
43
 
44
44
  Import domain classes directly from each store package and compose them:
45
45
 
46
- ```typescript
47
- import { MastraStorage } from "@mastra/core/storage";
46
+ ```typescript title="src/mastra/index.ts"
47
+ import { MastraCompositeStore } from "@mastra/core/storage";
48
48
  import { WorkflowsPG, ScoresPG } from "@mastra/pg";
49
49
  import { MemoryLibSQL } from "@mastra/libsql";
50
50
  import { Mastra } from "@mastra/core";
51
51
 
52
- const mastra = new Mastra({
53
- storage: new MastraStorage({
52
+ export const mastra = new Mastra({
53
+ storage: new MastraCompositeStore({
54
54
  id: "composite",
55
55
  domains: {
56
56
  memory: new MemoryLibSQL({ url: "file:./local.db" }),
@@ -65,8 +65,8 @@ const mastra = new Mastra({
65
65
 
66
66
  Use `default` to specify a fallback storage, then override specific domains:
67
67
 
68
- ```typescript
69
- import { MastraStorage } from "@mastra/core/storage";
68
+ ```typescript title="src/mastra/index.ts"
69
+ import { MastraCompositeStore } from "@mastra/core/storage";
70
70
  import { PostgresStore } from "@mastra/pg";
71
71
  import { MemoryLibSQL } from "@mastra/libsql";
72
72
  import { Mastra } from "@mastra/core";
@@ -76,8 +76,8 @@ const pgStore = new PostgresStore({
76
76
  connectionString: process.env.DATABASE_URL,
77
77
  });
78
78
 
79
- const mastra = new Mastra({
80
- storage: new MastraStorage({
79
+ export const mastra = new Mastra({
80
+ storage: new MastraCompositeStore({
81
81
  id: "composite",
82
82
  default: pgStore,
83
83
  domains: {
@@ -91,14 +91,14 @@ const mastra = new Mastra({
91
91
 
92
92
  ## Initialization
93
93
 
94
- MastraStorage initializes each configured domain independently. When passed to the Mastra class, `init()` is called automatically:
94
+ `MastraCompositeStore` initializes each configured domain independently. When passed to the Mastra class, `init()` is called automatically:
95
95
 
96
- ```typescript
97
- import { MastraStorage } from "@mastra/core/storage";
96
+ ```typescript title="src/mastra/index.ts"
97
+ import { MastraCompositeStore } from "@mastra/core/storage";
98
98
  import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
99
99
  import { Mastra } from "@mastra/core";
100
100
 
101
- const storage = new MastraStorage({
101
+ const storage = new MastraCompositeStore({
102
102
  id: "composite",
103
103
  domains: {
104
104
  memory: new MemoryPG({ connectionString: process.env.DATABASE_URL }),
@@ -107,7 +107,7 @@ const storage = new MastraStorage({
107
107
  },
108
108
  });
109
109
 
110
- const mastra = new Mastra({
110
+ export const mastra = new Mastra({
111
111
  storage, // init() called automatically
112
112
  });
113
113
  ```
@@ -115,10 +115,10 @@ const mastra = new Mastra({
115
115
  If using storage directly, call `init()` explicitly:
116
116
 
117
117
  ```typescript
118
- import { MastraStorage } from "@mastra/core/storage";
118
+ import { MastraCompositeStore } from "@mastra/core/storage";
119
119
  import { MemoryPG } from "@mastra/pg";
120
120
 
121
- const storage = new MastraStorage({
121
+ const storage = new MastraCompositeStore({
122
122
  id: "composite",
123
123
  domains: {
124
124
  memory: new MemoryPG({ connectionString: process.env.DATABASE_URL }),
@@ -132,18 +132,18 @@ const memoryStore = await storage.getStore("memory");
132
132
  const thread = await memoryStore?.getThreadById({ threadId: "..." });
133
133
  ```
134
134
 
135
- ## Use Cases
135
+ ## Use cases
136
136
 
137
137
  ### Separate databases for different workloads
138
138
 
139
139
  Use a local database for development while keeping production data in a managed service:
140
140
 
141
141
  ```typescript
142
- import { MastraStorage } from "@mastra/core/storage";
142
+ import { MastraCompositeStore } from "@mastra/core/storage";
143
143
  import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
144
144
  import { MemoryLibSQL } from "@mastra/libsql";
145
145
 
146
- const storage = new MastraStorage({
146
+ const storage = new MastraCompositeStore({
147
147
  id: "composite",
148
148
  domains: {
149
149
  // Use local SQLite for development, PostgreSQL for production
@@ -162,11 +162,11 @@ const storage = new MastraStorage({
162
162
  Use a time-series database for traces while keeping other data in PostgreSQL:
163
163
 
164
164
  ```typescript
165
- import { MastraStorage } from "@mastra/core/storage";
165
+ import { MastraCompositeStore } from "@mastra/core/storage";
166
166
  import { MemoryPG, WorkflowsPG, ScoresPG } from "@mastra/pg";
167
167
  import { ObservabilityStorageClickhouse } from "@mastra/clickhouse";
168
168
 
169
- const storage = new MastraStorage({
169
+ const storage = new MastraCompositeStore({
170
170
  id: "composite",
171
171
  domains: {
172
172
  memory: new MemoryPG({ connectionString: process.env.DATABASE_URL }),