@mastra/clickhouse 1.15.0-alpha.1 → 1.15.0-alpha.3

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,5 +1,35 @@
1
1
  # @mastra/clickhouse
2
2
 
3
+ ## 1.15.0-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixed a crash where updating a thread without a title (for example during observational memory buffering) could write a null title and violate the database's not-null constraint when running a newer @mastra/memory against an older storage package. Memory now checks whether the connected storage adapter supports partial thread updates and backfills the existing title for older adapters, so mixed-version deployments keep working. See #21041 for the original title-clobbering fix this makes backward compatible. ([#21257](https://github.com/mastra-ai/mastra/pull/21257))
8
+
9
+ - Storage adapters now declare support for partial thread updates, letting newer @mastra/memory preserve existing thread titles instead of overwriting them, while remaining safe against older versions. ([#21257](https://github.com/mastra-ai/mastra/pull/21257))
10
+
11
+ - Updated dependencies [[`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b), [`dc4a25d`](https://github.com/mastra-ai/mastra/commit/dc4a25d41af4e2fe97a816070eaec6aa963ab53b)]:
12
+ - @mastra/core@1.58.0-alpha.15
13
+
14
+ ## 1.15.0-alpha.2
15
+
16
+ ### Patch Changes
17
+
18
+ - Fixed generated thread titles being clobbered during a turn ([#21041](https://github.com/mastra-ai/mastra/pull/21041))
19
+
20
+ `updateThread` required both `title` and `metadata`, so callers that only needed to
21
+ change metadata (message persistence, working memory, observational memory, channel
22
+ subscriptions) had to read the thread and pass its title back. When title generation
23
+ finished between that read and the write, the freshly generated title was overwritten
24
+ with the stale one.
25
+
26
+ `title` and `metadata` are now independently optional: omitting one leaves that column
27
+ untouched. Callers that only change metadata no longer send a title, and message
28
+ persistence no longer rewrites a thread row it just read.
29
+
30
+ - Updated dependencies [[`1c75e32`](https://github.com/mastra-ai/mastra/commit/1c75e32f7fc0b9fb6f548b4407feaec8a1440212), [`c47165c`](https://github.com/mastra-ai/mastra/commit/c47165c983c87594c6952f1fd2fa51a90205034c), [`e08e789`](https://github.com/mastra-ai/mastra/commit/e08e789c1bf4cd2fe46363f7a4728536ceccc9bd), [`35cc901`](https://github.com/mastra-ai/mastra/commit/35cc90102cf834a84827acaf9eee0b6d6d1e2a3b), [`a8b4cf0`](https://github.com/mastra-ai/mastra/commit/a8b4cf02823cffebc4751a53337dfacf097c1ae1), [`f33264f`](https://github.com/mastra-ai/mastra/commit/f33264f517ae603279afd5c4251e2b40f6dd3618), [`689f2c4`](https://github.com/mastra-ai/mastra/commit/689f2c4b6c0835fe455702b01d21daa8abcd9331), [`eeae63e`](https://github.com/mastra-ai/mastra/commit/eeae63e7fbe8e1f237adc69bca6e2ac13c5ca907), [`4c186a0`](https://github.com/mastra-ai/mastra/commit/4c186a017275f45e6ed4c09de0f89550e2d09e8c), [`b0fa077`](https://github.com/mastra-ai/mastra/commit/b0fa077bcbc9b08551846fe372a0d3d15b71ed72)]:
31
+ - @mastra/core@1.58.0-alpha.8
32
+
3
33
  ## 1.15.0-alpha.1
4
34
 
5
35
  ### Patch Changes
@@ -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.15.0-alpha.1"
6
+ version: "1.15.0-alpha.3"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -14,9 +14,12 @@ Use this skill whenever you are working with @mastra/clickhouse to obtain the do
14
14
 
15
15
  Read the individual reference documents for detailed explanations and code examples.
16
16
 
17
+ ### Integrations
18
+
19
+ - [ClickHouse](references/integrations-databases-clickhouse.md) - Documentation for the ClickHouse storage implementation in Mastra, including the vNext observability domain.
20
+
17
21
  ### Reference
18
22
 
19
- - [Reference: ClickHouse storage](references/reference-storage-clickhouse.md) - Documentation for the ClickHouse storage implementation in Mastra, including the vNext observability domain.
20
23
  - [Reference: Composite storage](references/reference-storage-composite.md) - Documentation for combining multiple storage backends in Mastra.
21
24
 
22
25
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.15.0-alpha.1",
2
+ "version": "1.15.0-alpha.3",
3
3
  "package": "@mastra/clickhouse",
4
4
  "exports": {},
5
5
  "modules": {}
@@ -1,6 +1,6 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # ClickHouse storage
3
+ # ClickHouse
4
4
 
5
5
  [ClickHouse](https://clickhouse.com/) is a columnar database designed for analytical workloads. The `@mastra/clickhouse` package provides storage adapters for several Mastra storage domains and is the recommended backend for production observability.
6
6
 
@@ -10,7 +10,7 @@ ClickHouse is most commonly used as the dedicated observability backend in a [co
10
10
 
11
11
  Production observability for traces, logs, metrics, scores, and feedback.
12
12
 
13
- For local development, use a composite store that combines [LibSQL](https://mastra.ai/reference/storage/libsql) (for memory and workflows) and `@mastra/duckdb` (for observability). Neither alone covers a development setup: LibSQL doesn't implement the observability domain, and DuckDB doesn't implement the other domains. See the [observability overview](https://mastra.ai/docs/observability/overview) for an example.
13
+ For local development, use a composite store that combines [LibSQL](https://mastra.ai/integrations/databases/libsql) (for memory and workflows) and `@mastra/duckdb` (for observability). Neither alone covers a development setup: LibSQL doesn't implement the observability domain, and DuckDB doesn't implement the other domains. See the [observability overview](https://mastra.ai/docs/observability/overview) for an example.
14
14
 
15
15
  ## Installation
16
16
 
@@ -338,7 +338,7 @@ const storage = new MastraCompositeStore({
338
338
 
339
339
  Observability data can quickly overwhelm general-purpose databases in production. A single agent interaction can generate hundreds of spans, and high-traffic applications can produce thousands of traces per day.
340
340
 
341
- **[ClickHouse](https://mastra.ai/reference/storage/clickhouse)** is recommended for production observability because it's optimized for high-volume, write-heavy analytics workloads. Use composite storage to route observability to ClickHouse while keeping other data in your primary database:
341
+ **[ClickHouse](https://mastra.ai/integrations/databases/clickhouse)** is recommended for production observability because it's optimized for high-volume, write-heavy analytics workloads. Use composite storage to route observability to ClickHouse while keeping other data in your primary database:
342
342
 
343
343
  ```typescript
344
344
  import { MastraCompositeStore } from '@mastra/core/storage'
@@ -360,7 +360,7 @@ const storage = new MastraCompositeStore({
360
360
  })
361
361
  ```
362
362
 
363
- > **Note:** `ObservabilityStorageClickhouseVNext` is the current observability domain implementation. The legacy `ObservabilityStorageClickhouse` class is also exported and remains supported for projects that haven't migrated. See the [ClickHouse storage reference](https://mastra.ai/reference/storage/clickhouse) for details.
363
+ > **Note:** `ObservabilityStorageClickhouseVNext` is the current observability domain implementation. The legacy `ObservabilityStorageClickhouse` class is also exported and remains supported for projects that haven't migrated. See the [ClickHouse storage reference](https://mastra.ai/integrations/databases/clickhouse) for details.
364
364
 
365
365
  ### Replicated ClickHouse for multi-replica clusters
366
366
 
@@ -392,6 +392,6 @@ const storage = new MastraCompositeStore({
392
392
  })
393
393
  ```
394
394
 
395
- Don't set `replication` on ClickHouse Cloud. Cloud rewrites `MergeTree` to `SharedMergeTree` server-side. See the [ClickHouse storage reference](https://mastra.ai/reference/storage/clickhouse) for the full config shape and operator notes.
395
+ Don't set `replication` on ClickHouse Cloud. Cloud rewrites `MergeTree` to `SharedMergeTree` server-side. See the [ClickHouse storage reference](https://mastra.ai/integrations/databases/clickhouse) for the full config shape and operator notes.
396
396
 
397
- > **Info:** This approach is also required when using storage providers that don't support observability (like Convex, DynamoDB, or Cloudflare). See the [MastraStorageExporter documentation](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for the full list of supported providers.
397
+ > **Note:** This approach is also required when using storage providers that don't support observability (like Convex, DynamoDB, or Cloudflare). See the [MastraStorageExporter documentation](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for the full list of supported providers.
package/dist/index.cjs CHANGED
@@ -1015,6 +1015,7 @@ function appendClickhouseMessageMetadataFilter(query, params, metadataFilter) {
1015
1015
  return nextQuery;
1016
1016
  }
1017
1017
  var MemoryStorageClickhouse = class extends _mastra_core_storage.MemoryStorage {
1018
+ supportsPartialThreadUpdate = true;
1018
1019
  client;
1019
1020
  #db;
1020
1021
  constructor(config) {
@@ -1574,7 +1575,7 @@ var MemoryStorageClickhouse = class extends _mastra_core_storage.MemoryStorage {
1574
1575
  };
1575
1576
  const updatedThread = {
1576
1577
  ...existingThread,
1577
- title,
1578
+ title: title ?? existingThread.title,
1578
1579
  metadata: mergedMetadata,
1579
1580
  updatedAt: /* @__PURE__ */ new Date()
1580
1581
  };
@@ -1603,7 +1604,7 @@ var MemoryStorageClickhouse = class extends _mastra_core_storage.MemoryStorage {
1603
1604
  category: _mastra_core_error.ErrorCategory.THIRD_PARTY,
1604
1605
  details: {
1605
1606
  threadId: id,
1606
- title
1607
+ title: title ?? null
1607
1608
  }
1608
1609
  }, error);
1609
1610
  }