@mastra/pg 1.14.2-alpha.0 → 1.14.2-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/CHANGELOG.md +11 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +25 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +25 -11
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/workflows/index.d.ts.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @mastra/pg
|
|
2
2
|
|
|
3
|
+
## 1.14.2-alpha.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Fixed workflow runs advancing their update time when re-persisted in PostgreSQL storage. ([#18004](https://github.com/mastra-ai/mastra/pull/18004))
|
|
8
|
+
|
|
9
|
+
- Negated numeric range filters (`$not` with `$gt`, `$gte`, `$lt`, `$lte`) now correctly exclude rows where the filtered field is missing or non-numeric. Previously these rows were incorrectly included in results. ([#18466](https://github.com/mastra-ai/mastra/pull/18466))
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`bf3fe49`](https://github.com/mastra-ai/mastra/commit/bf3fe49f9467dbbdb8f9eaf74e0f7971ffb19559), [`24ceaea`](https://github.com/mastra-ai/mastra/commit/24ceaea0bdd8609cabbab764380608ca6621a194), [`6ccf67b`](https://github.com/mastra-ai/mastra/commit/6ccf67bf075753754927a57bc2e1734ba2c820c5), [`825d8de`](https://github.com/mastra-ai/mastra/commit/825d8def9fa64c2bcc3d8dd6b49e09342c3ac5c7), [`ffa09e7`](https://github.com/mastra-ai/mastra/commit/ffa09e772a5c92270eabe2090fc42d45bd8ec4b7), [`461a7c5`](https://github.com/mastra-ai/mastra/commit/461a7c501449295287f4f0ee4b0b42344f39fcf8), [`4211472`](https://github.com/mastra-ai/mastra/commit/4211472a5a2bd319c60cd2e42d9109c3eef7ac1c), [`9e45902`](https://github.com/mastra-ai/mastra/commit/9e4590208e745055cecca202e2db0e5c65e17d3c), [`5c0df77`](https://github.com/mastra-ai/mastra/commit/5c0df776c40efa420f8c07a2f3ee66010296618e)]:
|
|
12
|
+
- @mastra/core@1.47.0-alpha.3
|
|
13
|
+
|
|
3
14
|
## 1.14.2-alpha.0
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -185,7 +185,7 @@ var createNumericOperator = (symbol) => {
|
|
|
185
185
|
const isNumeric = typeof value === "number" || typeof value === "string" && !isNaN(Number(value)) && value.trim() !== "";
|
|
186
186
|
if (isNumeric) {
|
|
187
187
|
return {
|
|
188
|
-
sql: `(CASE WHEN jsonb_typeof(metadata#>'{${jsonPathKey}}') = 'number' THEN (metadata#>>'{${jsonPathKey}}')::numeric ${symbol} $${paramIndex}::numeric ELSE
|
|
188
|
+
sql: `(CASE WHEN jsonb_typeof(metadata#>'{${jsonPathKey}}') = 'number' THEN (metadata#>>'{${jsonPathKey}}')::numeric ${symbol} $${paramIndex}::numeric ELSE NULL END)`,
|
|
189
189
|
needsValue: true
|
|
190
190
|
};
|
|
191
191
|
} else {
|
|
@@ -18300,11 +18300,12 @@ var WorkflowsPG = class _WorkflowsPG extends storage.WorkflowsStorage {
|
|
|
18300
18300
|
const now = /* @__PURE__ */ new Date();
|
|
18301
18301
|
const sanitizedSnapshot = sanitizeJsonForPg(JSON.stringify(snapshot));
|
|
18302
18302
|
await t.none(
|
|
18303
|
-
`INSERT INTO ${tableName}
|
|
18304
|
-
|
|
18303
|
+
`INSERT INTO ${tableName}
|
|
18304
|
+
(workflow_name, run_id, snapshot, "createdAt", "updatedAt", "createdAtZ", "updatedAtZ")
|
|
18305
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7)
|
|
18305
18306
|
ON CONFLICT (workflow_name, run_id) DO UPDATE
|
|
18306
|
-
SET snapshot = $3, "updatedAt" = $5`,
|
|
18307
|
-
[workflowName, runId, sanitizedSnapshot, now, now]
|
|
18307
|
+
SET snapshot = $3, "updatedAt" = $5, "updatedAtZ" = $7`,
|
|
18308
|
+
[workflowName, runId, sanitizedSnapshot, now, now, now, now]
|
|
18308
18309
|
);
|
|
18309
18310
|
return snapshot.context;
|
|
18310
18311
|
});
|
|
@@ -18346,9 +18347,12 @@ var WorkflowsPG = class _WorkflowsPG extends storage.WorkflowsStorage {
|
|
|
18346
18347
|
}
|
|
18347
18348
|
const updatedSnapshot = { ...snapshot, ...opts };
|
|
18348
18349
|
const sanitizedSnapshot = sanitizeJsonForPg(JSON.stringify(updatedSnapshot));
|
|
18350
|
+
const now = /* @__PURE__ */ new Date();
|
|
18349
18351
|
await t.none(
|
|
18350
|
-
`UPDATE ${tableName}
|
|
18351
|
-
|
|
18352
|
+
`UPDATE ${tableName}
|
|
18353
|
+
SET snapshot = $1, "updatedAt" = $2, "updatedAtZ" = $3
|
|
18354
|
+
WHERE workflow_name = $4 AND run_id = $5`,
|
|
18355
|
+
[sanitizedSnapshot, now, now, workflowName, runId]
|
|
18352
18356
|
);
|
|
18353
18357
|
return updatedSnapshot;
|
|
18354
18358
|
});
|
|
@@ -18381,11 +18385,21 @@ var WorkflowsPG = class _WorkflowsPG extends storage.WorkflowsStorage {
|
|
|
18381
18385
|
const updatedAtValue = updatedAt ? updatedAt : now;
|
|
18382
18386
|
const sanitizedSnapshot = sanitizeJsonForPg(JSON.stringify(snapshot));
|
|
18383
18387
|
await this.#db.client.none(
|
|
18384
|
-
`INSERT INTO ${getTableName7({ indexName: storage.TABLE_WORKFLOW_SNAPSHOT, schemaName: getSchemaName7(this.#schema) })}
|
|
18385
|
-
|
|
18388
|
+
`INSERT INTO ${getTableName7({ indexName: storage.TABLE_WORKFLOW_SNAPSHOT, schemaName: getSchemaName7(this.#schema) })}
|
|
18389
|
+
(workflow_name, run_id, "resourceId", snapshot, "createdAt", "updatedAt", "createdAtZ", "updatedAtZ")
|
|
18390
|
+
VALUES ($1, $2, $3, $4, $5, $6, $7, $8)
|
|
18386
18391
|
ON CONFLICT (workflow_name, run_id) DO UPDATE
|
|
18387
|
-
SET "resourceId" = $3, snapshot = $4, "updatedAt" = $6`,
|
|
18388
|
-
[
|
|
18392
|
+
SET "resourceId" = $3, snapshot = $4, "updatedAt" = $6, "updatedAtZ" = $8`,
|
|
18393
|
+
[
|
|
18394
|
+
workflowName,
|
|
18395
|
+
runId,
|
|
18396
|
+
resourceId,
|
|
18397
|
+
sanitizedSnapshot,
|
|
18398
|
+
createdAtValue,
|
|
18399
|
+
updatedAtValue,
|
|
18400
|
+
createdAtValue,
|
|
18401
|
+
updatedAtValue
|
|
18402
|
+
]
|
|
18389
18403
|
);
|
|
18390
18404
|
} catch (error$1) {
|
|
18391
18405
|
throw new error.MastraError(
|