@mastra/cloudflare-d1 1.4.5-alpha.2 → 1.4.5

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.5-alpha.2"
6
+ version: "1.4.5"
7
7
  ---
8
8
 
9
9
  ## When to use
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.4.5-alpha.2",
2
+ "version": "1.4.5",
3
3
  "package": "@mastra/cloudflare-d1",
4
4
  "exports": {},
5
5
  "modules": {}
package/dist/index.cjs CHANGED
@@ -87,7 +87,7 @@ var SqlBuilder = class {
87
87
  */
88
88
  whereAnd(condition, ...params) {
89
89
  if (this.whereAdded) return this.andWhere(condition, ...params);
90
- else return this.where(condition, ...params);
90
+ return this.where(condition, ...params);
91
91
  }
92
92
  andWhere(condition, ...params) {
93
93
  this.sql += ` AND ${condition}`;
@@ -405,18 +405,16 @@ var D1DB = class extends _mastra_core_base.MastraBase {
405
405
  result = await statement.bind(...formattedParams).first();
406
406
  if (!result) return null;
407
407
  return result;
408
- } else {
409
- result = await statement.bind(...formattedParams).all();
410
- return result.results || [];
411
408
  }
409
+ result = await statement.bind(...formattedParams).all();
410
+ return result.results || [];
412
411
  } else if (first) {
413
412
  result = await statement.first();
414
413
  if (!result) return null;
415
414
  return result;
416
- } else {
417
- result = await statement.all();
418
- return result.results || [];
419
415
  }
416
+ result = await statement.all();
417
+ return result.results || [];
420
418
  } catch (error) {
421
419
  throw new _mastra_core_error.MastraError({
422
420
  id: (0, _mastra_core_storage.createStorageErrorId)("CLOUDFLARE_D1", "WORKERS_BINDING_QUERY", "FAILED"),
@@ -463,7 +461,7 @@ var D1DB = class extends _mastra_core_base.MastraBase {
463
461
  async executeQuery(options) {
464
462
  if (this.binding) return this.executeWorkersBindingQuery(options);
465
463
  else if (this.client) return this.executeRestQuery(options);
466
- else throw new Error("Neither binding nor client is configured");
464
+ throw new Error("Neither binding nor client is configured");
467
465
  }
468
466
  /**
469
467
  * Gets the set of column names that actually exist in the database table.