@mastra/clickhouse 1.28.0-alpha.0 → 1.28.0-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.
@@ -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.28.0-alpha.0"
6
+ version: "1.28.0-alpha.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.28.0-alpha.0",
2
+ "version": "1.28.0-alpha.1",
3
3
  "package": "@mastra/clickhouse",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -781,6 +781,7 @@ var ClickhouseDB = class extends _mastra_core_base.MastraBase {
781
781
  const rawUpdatedAt = filteredRecord.updatedAt || /* @__PURE__ */ new Date();
782
782
  if ("createdAt" in filteredRecord || (await this.getTableColumns(tableName)).has("createdAt")) filteredRecord.createdAt = rawCreatedAt instanceof Date ? rawCreatedAt.toISOString() : rawCreatedAt;
783
783
  if ("updatedAt" in filteredRecord || (await this.getTableColumns(tableName)).has("updatedAt")) filteredRecord.updatedAt = rawUpdatedAt instanceof Date ? rawUpdatedAt.toISOString() : rawUpdatedAt;
784
+ for (const [key, value] of Object.entries(filteredRecord)) if (_mastra_core_storage.TABLE_SCHEMAS[tableName]?.[key]?.type === "timestamp" && typeof value === "number") filteredRecord[key] = new Date(value).toISOString();
784
785
  await this.client.insert({
785
786
  table: tableName,
786
787
  values: [filteredRecord],
@@ -2293,12 +2294,12 @@ var ObservabilityStorageClickhouse = class extends _mastra_core_storage.Observab
2293
2294
  }
2294
2295
  });
2295
2296
  const data = { ...updates };
2296
- if (data.endedAt instanceof Date) data.endedAt = data.endedAt.getTime();
2297
- if (data.startedAt instanceof Date) data.startedAt = data.startedAt.getTime();
2297
+ if (data.endedAt instanceof Date) data.endedAt = data.endedAt.toISOString();
2298
+ if (data.startedAt instanceof Date) data.startedAt = data.startedAt.toISOString();
2298
2299
  const updated = {
2299
2300
  ...existing,
2300
2301
  ...data,
2301
- updatedAt: Date.now()
2302
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
2302
2303
  };
2303
2304
  await this.client.insert({
2304
2305
  table: _mastra_core_storage.TABLE_SPANS,
@@ -2536,7 +2537,7 @@ var ObservabilityStorageClickhouse = class extends _mastra_core_storage.Observab
2536
2537
  }
2537
2538
  async batchUpdateSpans(args) {
2538
2539
  try {
2539
- const now = Date.now();
2540
+ const now = (/* @__PURE__ */ new Date()).toISOString();
2540
2541
  if (args.records.length === 0) return;
2541
2542
  const keyParams = {};
2542
2543
  const keyTuples = args.records.map((record, i) => {
@@ -2569,8 +2570,8 @@ var ObservabilityStorageClickhouse = class extends _mastra_core_storage.Observab
2569
2570
  const existing = current.get(key);
2570
2571
  if (!existing) continue;
2571
2572
  const updates = { ...record.updates };
2572
- if (updates.startedAt instanceof Date) updates.startedAt = updates.startedAt.getTime();
2573
- if (updates.endedAt instanceof Date) updates.endedAt = updates.endedAt.getTime();
2573
+ if (updates.startedAt instanceof Date) updates.startedAt = updates.startedAt.toISOString();
2574
+ if (updates.endedAt instanceof Date) updates.endedAt = updates.endedAt.toISOString();
2574
2575
  current.set(key, {
2575
2576
  ...existing,
2576
2577
  ...updates,