@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.
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +6 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/dist/storage/db/index.d.ts.map +1 -1
- package/dist/storage/sql-builder.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -64,7 +64,7 @@ var SqlBuilder = class {
|
|
|
64
64
|
*/
|
|
65
65
|
whereAnd(condition, ...params) {
|
|
66
66
|
if (this.whereAdded) return this.andWhere(condition, ...params);
|
|
67
|
-
|
|
67
|
+
return this.where(condition, ...params);
|
|
68
68
|
}
|
|
69
69
|
andWhere(condition, ...params) {
|
|
70
70
|
this.sql += ` AND ${condition}`;
|
|
@@ -382,18 +382,16 @@ var D1DB = class extends MastraBase {
|
|
|
382
382
|
result = await statement.bind(...formattedParams).first();
|
|
383
383
|
if (!result) return null;
|
|
384
384
|
return result;
|
|
385
|
-
} else {
|
|
386
|
-
result = await statement.bind(...formattedParams).all();
|
|
387
|
-
return result.results || [];
|
|
388
385
|
}
|
|
386
|
+
result = await statement.bind(...formattedParams).all();
|
|
387
|
+
return result.results || [];
|
|
389
388
|
} else if (first) {
|
|
390
389
|
result = await statement.first();
|
|
391
390
|
if (!result) return null;
|
|
392
391
|
return result;
|
|
393
|
-
} else {
|
|
394
|
-
result = await statement.all();
|
|
395
|
-
return result.results || [];
|
|
396
392
|
}
|
|
393
|
+
result = await statement.all();
|
|
394
|
+
return result.results || [];
|
|
397
395
|
} catch (error) {
|
|
398
396
|
throw new MastraError({
|
|
399
397
|
id: createStorageErrorId("CLOUDFLARE_D1", "WORKERS_BINDING_QUERY", "FAILED"),
|
|
@@ -440,7 +438,7 @@ var D1DB = class extends MastraBase {
|
|
|
440
438
|
async executeQuery(options) {
|
|
441
439
|
if (this.binding) return this.executeWorkersBindingQuery(options);
|
|
442
440
|
else if (this.client) return this.executeRestQuery(options);
|
|
443
|
-
|
|
441
|
+
throw new Error("Neither binding nor client is configured");
|
|
444
442
|
}
|
|
445
443
|
/**
|
|
446
444
|
* Gets the set of column names that actually exist in the database table.
|