@mastra/clickhouse 1.30.0 → 1.30.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/dist/index.js CHANGED
@@ -6663,7 +6663,7 @@ async function listScores(client, args, strategy) {
6663
6663
  const deltaCursorEnabled = deltaPollingSupported(strategy);
6664
6664
  const filter = buildScoresFilterConditions(parsed.filters, "s");
6665
6665
  const pagination = buildPaginationClause(parsed.pagination);
6666
- const orderBy = buildSignalOrderByClause(["timestamp", "score"], parsed.orderBy, "s");
6666
+ const orderBy = `${buildSignalOrderByClause(["timestamp", "score"], parsed.orderBy, "s")}, s.scoreId ${parsed.orderBy?.direction === "ASC" ? "ASC" : "DESC"}`;
6667
6667
  const whereClause = filter.conditions.length ? `WHERE ${filter.conditions.join(" AND ")}` : "";
6668
6668
  if (parsed.mode === "delta") {
6669
6669
  assertDeltaPollingSupported(strategy);
@@ -7333,6 +7333,7 @@ function isMetadataField(field) {
7333
7333
  return field.startsWith("metadata.");
7334
7334
  }
7335
7335
  function compileScalarPredicate(predicate, registry, parameters, allowMetadata = false) {
7336
+ if (predicate.type === "tokens") throw new coreStorage.TraceQueryUnsupportedError("Indexed token search is not supported by this store");
7336
7337
  if (predicate.type === "boolean") return predicate.args.map((arg) => `(${compileScalarPredicate(arg, registry, parameters, allowMetadata)})`).join(predicate.operator === "and" ? " AND " : " OR ");
7337
7338
  if (predicate.type === "not") return `NOT (${compileScalarPredicate(predicate.arg, registry, parameters, allowMetadata)})`;
7338
7339
  const field = isMetadataField(predicate.field) ? (() => {
@@ -8238,6 +8239,7 @@ function predicateFields$1(predicate, fields = /* @__PURE__ */ new Set()) {
8238
8239
  if (!predicate) return fields;
8239
8240
  if (predicate.type === "boolean") for (const arg of predicate.args) predicateFields$1(arg, fields);
8240
8241
  else if (predicate.type === "not") predicateFields$1(predicate.arg, fields);
8242
+ else if (predicate.type === "tokens") return fields;
8241
8243
  else fields.add(predicate.field);
8242
8244
  return fields;
8243
8245
  }
@@ -8545,6 +8547,7 @@ function predicateFields(predicate, fields = /* @__PURE__ */ new Set()) {
8545
8547
  if (!predicate) return fields;
8546
8548
  if (predicate.type === "boolean") for (const arg of predicate.args) predicateFields(arg, fields);
8547
8549
  else if (predicate.type === "not") predicateFields(predicate.arg, fields);
8550
+ else if (predicate.type === "tokens") return fields;
8548
8551
  else fields.add(predicate.field);
8549
8552
  return fields;
8550
8553
  }