@mastra/clickhouse 1.5.0 → 1.5.1-alpha.1

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,23 @@
1
1
  # @mastra/clickhouse
2
2
 
3
+ ## 1.5.1-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Improved ClickHouse v-next observability initialization errors to include the underlying ClickHouse message in the standard error text. This makes init failures actionable in loggers that only print `error.message`. ([#15588](https://github.com/mastra-ai/mastra/pull/15588))
8
+
9
+ - Updated dependencies [[`0a0aa94`](https://github.com/mastra-ai/mastra/commit/0a0aa94729592e99885af2efb90c56aaada62247), [`01a7d51`](https://github.com/mastra-ai/mastra/commit/01a7d513493d21562f677f98550f7ceb165ba78c)]:
10
+ - @mastra/core@1.27.0-alpha.1
11
+
12
+ ## 1.5.1-alpha.0
13
+
14
+ ### Patch Changes
15
+
16
+ - Fixed `mastra dev` repeatedly reporting `MIGRATION REQUIRED` on ClickHouse Cloud after `mastra migrate` had already run successfully. The observability migration check now recognizes the engine-name variants that ClickHouse Cloud and replicated clusters use in place of `ReplacingMergeTree`. ([#15623](https://github.com/mastra-ai/mastra/pull/15623))
17
+
18
+ - Updated dependencies [[`f112db1`](https://github.com/mastra-ai/mastra/commit/f112db179557ae9b5a0f1d25dc47f928d7d61cd9), [`21d9706`](https://github.com/mastra-ai/mastra/commit/21d970604d89eee970cbf8013d26d7551aff6ea5)]:
19
+ - @mastra/core@1.26.1-alpha.0
20
+
3
21
  ## 1.5.0
4
22
 
5
23
  ### Minor 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.5.0"
6
+ version: "1.5.1-alpha.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.0",
2
+ "version": "1.5.1-alpha.1",
3
3
  "package": "@mastra/clickhouse",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -4983,6 +4983,9 @@ var SIGNAL_MIGRATIONS = [
4983
4983
  { table: TABLE_SCORE_EVENTS, createDDL: SCORE_EVENTS_DDL, idColumn: "scoreId" },
4984
4984
  { table: TABLE_FEEDBACK_EVENTS, createDDL: FEEDBACK_EVENTS_DDL, idColumn: "feedbackId" }
4985
4985
  ];
4986
+ function isReplacingMergeTreeEngine(engine) {
4987
+ return engine.endsWith("ReplacingMergeTree");
4988
+ }
4986
4989
  async function getTableEngine(client, table) {
4987
4990
  const result = await client.query({
4988
4991
  query: `SELECT engine FROM system.tables WHERE database = currentDatabase() AND name = {table:String}`,
@@ -5020,7 +5023,7 @@ async function checkSignalTablesMigrationStatus(client) {
5020
5023
  const tables = [];
5021
5024
  for (const { table, idColumn } of SIGNAL_MIGRATIONS) {
5022
5025
  const engine = await getTableEngine(client, table);
5023
- if (!engine || engine === "ReplacingMergeTree") {
5026
+ if (!engine || isReplacingMergeTreeEngine(engine)) {
5024
5027
  continue;
5025
5028
  }
5026
5029
  tables.push({ table, engine, idColumn });
@@ -5033,7 +5036,7 @@ async function checkSignalTablesMigrationStatus(client) {
5033
5036
  async function migrateSignalTables(client, logger) {
5034
5037
  for (const { table, createDDL, idColumn } of SIGNAL_MIGRATIONS) {
5035
5038
  const engine = await getTableEngine(client, table);
5036
- if (!engine || engine === "ReplacingMergeTree") continue;
5039
+ if (!engine || isReplacingMergeTreeEngine(engine)) continue;
5037
5040
  logger?.info?.(`Migrating ${table} from ${engine} to ReplacingMergeTree with ${idColumn} column`);
5038
5041
  const temp = `${table}_migrating_${Date.now()}`;
5039
5042
  try {
@@ -5648,12 +5651,13 @@ var ObservabilityStorageClickhouseVNext = class extends storage.ObservabilitySto
5648
5651
  if (error$1 instanceof error.MastraError) {
5649
5652
  throw error$1;
5650
5653
  }
5654
+ const causeMessage = error$1 instanceof Error ? error$1.message : String(error$1);
5651
5655
  throw new error.MastraError(
5652
5656
  {
5653
5657
  id: storage.createStorageErrorId("CLICKHOUSE", "VNEXT_INIT", "FAILED"),
5654
5658
  domain: error.ErrorDomain.STORAGE,
5655
5659
  category: error.ErrorCategory.THIRD_PARTY,
5656
- text: "Failed to initialize ClickHouse v-next observability tables"
5660
+ text: `Failed to initialize ClickHouse v-next observability tables: ${causeMessage}`
5657
5661
  },
5658
5662
  error$1
5659
5663
  );