@mastra/cloudflare-d1 1.4.0 → 1.4.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-cloudflare-d1
3
3
  description: Documentation for @mastra/cloudflare-d1. Use when working with @mastra/cloudflare-d1 APIs, configuration, or implementation.
4
4
  metadata:
5
5
  package: "@mastra/cloudflare-d1"
6
- version: "1.4.0"
6
+ version: "1.4.1"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.0",
2
+ "version": "1.4.1",
3
3
  "package": "@mastra/cloudflare-d1",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -2278,8 +2278,8 @@ var WorkflowsStorageD1 = class extends _mastra_core_storage.WorkflowsStorage {
2278
2278
  const countBuilder = createSqlBuilder().count().from(fullTableName);
2279
2279
  if (workflowName) builder.whereAnd("workflow_name = ?", workflowName);
2280
2280
  if (status) {
2281
- builder.whereAnd("json_extract(snapshot, '$.status') = ?", status);
2282
- countBuilder.whereAnd("json_extract(snapshot, '$.status') = ?", status);
2281
+ builder.whereAnd("CASE WHEN json_valid(snapshot) THEN json_extract(snapshot, '$.status') END = ?", status);
2282
+ countBuilder.whereAnd("CASE WHEN json_valid(snapshot) THEN json_extract(snapshot, '$.status') END = ?", status);
2283
2283
  }
2284
2284
  if (resourceId) if (await this.#db.hasColumn(fullTableName, "resourceId")) {
2285
2285
  builder.whereAnd("resourceId = ?", resourceId);