@mastra/clickhouse 1.0.0-beta.5 → 1.0.0-beta.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.
package/dist/index.js CHANGED
@@ -1214,14 +1214,18 @@ var StoreOperationsClickhouse = class extends StoreOperations {
1214
1214
  getSqlType(type) {
1215
1215
  switch (type) {
1216
1216
  case "text":
1217
+ case "uuid":
1218
+ case "jsonb":
1217
1219
  return "String";
1218
1220
  case "timestamp":
1219
1221
  return "DateTime64(3)";
1220
1222
  case "integer":
1221
1223
  case "bigint":
1222
1224
  return "Int64";
1223
- case "jsonb":
1224
- return "String";
1225
+ case "float":
1226
+ return "Float64";
1227
+ case "boolean":
1228
+ return "Bool";
1225
1229
  default:
1226
1230
  return super.getSqlType(type);
1227
1231
  }
@@ -1238,7 +1242,7 @@ var StoreOperationsClickhouse = class extends StoreOperations {
1238
1242
  constraints.push("DEFAULT '{}'");
1239
1243
  }
1240
1244
  const columnTtl = this.ttl?.[tableName]?.columns?.[name];
1241
- return `"${name}" ${COLUMN_TYPES[def.type]} ${constraints.join(" ")} ${columnTtl ? `TTL toDateTime(${columnTtl.ttlKey ?? "createdAt"}) + INTERVAL ${columnTtl.interval} ${columnTtl.unit}` : ""}`;
1245
+ return `"${name}" ${this.getSqlType(def.type)} ${constraints.join(" ")} ${columnTtl ? `TTL toDateTime(${columnTtl.ttlKey ?? "createdAt"}) + INTERVAL ${columnTtl.interval} ${columnTtl.unit}` : ""}`;
1242
1246
  }).join(",\n");
1243
1247
  const rowTtl = this.ttl?.[tableName]?.row;
1244
1248
  const sql = tableName === TABLE_WORKFLOW_SNAPSHOT ? `
@@ -1422,7 +1426,7 @@ var StoreOperationsClickhouse = class extends StoreOperations {
1422
1426
  const engine = TABLE_ENGINES[tableName] ?? "MergeTree()";
1423
1427
  const keyEntries = Object.entries(keys);
1424
1428
  const conditions = keyEntries.map(
1425
- ([key]) => `"${key}" = {var_${key}:${COLUMN_TYPES[TABLE_SCHEMAS[tableName]?.[key]?.type ?? "text"]}}`
1429
+ ([key]) => `"${key}" = {var_${key}:${this.getSqlType(TABLE_SCHEMAS[tableName]?.[key]?.type ?? "text")}}`
1426
1430
  ).join(" AND ");
1427
1431
  const values = keyEntries.reduce((acc, [key, value]) => {
1428
1432
  return { ...acc, [`var_${key}`]: value };