@mastra/pg 0.10.2 → 0.10.4-alpha.0
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/.turbo/turbo-build.log +7 -7
- package/CHANGELOG.md +20 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +8 -8
- package/src/storage/index.test.ts +4 -0
- package/src/storage/index.ts +3 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/pg@0.10.
|
|
2
|
+
> @mastra/pg@0.10.4-alpha.0 build /home/runner/work/mastra/mastra/stores/pg
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.5.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 11001ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
11
|
[34mCLI[39m Target: es2022
|
|
12
12
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
13
13
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/pg/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
14
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
15
15
|
[36mWriting package typings: /home/runner/work/mastra/mastra/stores/pg/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
+
[32mDTS[39m ⚡️ Build success in 11284ms
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
|
-
[32mESM[39m [1mdist/index.js [22m[32m67.
|
|
21
|
-
[32mESM[39m ⚡️ Build success in
|
|
22
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m67.
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in
|
|
20
|
+
[32mESM[39m [1mdist/index.js [22m[32m67.19 KB[39m
|
|
21
|
+
[32mESM[39m ⚡️ Build success in 1382ms
|
|
22
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m67.75 KB[39m
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 1382ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @mastra/pg
|
|
2
2
|
|
|
3
|
+
## 0.10.4-alpha.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 63f6b7d: dependencies updates:
|
|
8
|
+
- Updated dependency [`pg-promise@^11.14.0` ↗︎](https://www.npmjs.com/package/pg-promise/v/11.14.0) (from `^11.13.0`, in `dependencies`)
|
|
9
|
+
- Updated dependencies [63f6b7d]
|
|
10
|
+
- Updated dependencies [36f1c36]
|
|
11
|
+
- Updated dependencies [10d352e]
|
|
12
|
+
- Updated dependencies [53d3c37]
|
|
13
|
+
- @mastra/core@0.10.6-alpha.0
|
|
14
|
+
|
|
15
|
+
## 0.10.3
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 3c77c0a: fix(pg): allow dotted attribute keys in `getTraces` by using `parseFieldKey` instead of `parseSqlIdentifier`
|
|
20
|
+
- Updated dependencies [13c97f9]
|
|
21
|
+
- @mastra/core@0.10.5
|
|
22
|
+
|
|
3
23
|
## 0.10.2
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -1037,14 +1037,14 @@ var PostgresStore = class extends storage.MastraStorage {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
if (attributes) {
|
|
1039
1039
|
Object.entries(attributes).forEach(([key, value]) => {
|
|
1040
|
-
const parsedKey = utils.
|
|
1040
|
+
const parsedKey = utils.parseFieldKey(key);
|
|
1041
1041
|
conditions.push(`attributes->>'${parsedKey}' = $${paramIndex++}`);
|
|
1042
1042
|
queryParams.push(value);
|
|
1043
1043
|
});
|
|
1044
1044
|
}
|
|
1045
1045
|
if (filters) {
|
|
1046
1046
|
Object.entries(filters).forEach(([key, value]) => {
|
|
1047
|
-
const parsedKey = utils.
|
|
1047
|
+
const parsedKey = utils.parseFieldKey(key);
|
|
1048
1048
|
conditions.push(`"${parsedKey}" = $${paramIndex++}`);
|
|
1049
1049
|
queryParams.push(value);
|
|
1050
1050
|
});
|
package/dist/index.js
CHANGED
|
@@ -1029,14 +1029,14 @@ var PostgresStore = class extends MastraStorage {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
if (attributes) {
|
|
1031
1031
|
Object.entries(attributes).forEach(([key, value]) => {
|
|
1032
|
-
const parsedKey =
|
|
1032
|
+
const parsedKey = parseFieldKey(key);
|
|
1033
1033
|
conditions.push(`attributes->>'${parsedKey}' = $${paramIndex++}`);
|
|
1034
1034
|
queryParams.push(value);
|
|
1035
1035
|
});
|
|
1036
1036
|
}
|
|
1037
1037
|
if (filters) {
|
|
1038
1038
|
Object.entries(filters).forEach(([key, value]) => {
|
|
1039
|
-
const parsedKey =
|
|
1039
|
+
const parsedKey = parseFieldKey(key);
|
|
1040
1040
|
conditions.push(`"${parsedKey}" = $${paramIndex++}`);
|
|
1041
1041
|
queryParams.push(value);
|
|
1042
1042
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/pg",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.4-alpha.0",
|
|
4
4
|
"description": "Postgres provider for Mastra - includes both vector and db storage capabilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,20 +22,20 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"async-mutex": "^0.5.0",
|
|
24
24
|
"pg": "^8.16.0",
|
|
25
|
-
"pg-promise": "^11.
|
|
25
|
+
"pg-promise": "^11.14.0",
|
|
26
26
|
"xxhash-wasm": "^1.1.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@microsoft/api-extractor": "^7.52.8",
|
|
30
|
-
"@types/node": "^20.
|
|
30
|
+
"@types/node": "^20.19.0",
|
|
31
31
|
"@types/pg": "^8.15.4",
|
|
32
32
|
"eslint": "^9.28.0",
|
|
33
33
|
"tsup": "^8.5.0",
|
|
34
|
-
"typescript": "^5.8.
|
|
35
|
-
"vitest": "^3.2.
|
|
36
|
-
"@internal/
|
|
37
|
-
"@mastra/core": "0.10.
|
|
38
|
-
"@internal/
|
|
34
|
+
"typescript": "^5.8.3",
|
|
35
|
+
"vitest": "^3.2.3",
|
|
36
|
+
"@internal/lint": "0.0.12",
|
|
37
|
+
"@mastra/core": "0.10.6-alpha.0",
|
|
38
|
+
"@internal/storage-test-utils": "0.0.8"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@mastra/core": ">=0.10.4-0 <0.11.0"
|
|
@@ -408,6 +408,7 @@ describe('PostgresStore', () => {
|
|
|
408
408
|
suspendedPaths: {},
|
|
409
409
|
runId,
|
|
410
410
|
timestamp: new Date().getTime(),
|
|
411
|
+
serializedStepGraph: [],
|
|
411
412
|
} as unknown as WorkflowRunState;
|
|
412
413
|
|
|
413
414
|
await store.persistWorkflowSnapshot({
|
|
@@ -446,6 +447,7 @@ describe('PostgresStore', () => {
|
|
|
446
447
|
suspendedPaths: {},
|
|
447
448
|
runId,
|
|
448
449
|
timestamp: new Date().getTime(),
|
|
450
|
+
serializedStepGraph: [],
|
|
449
451
|
};
|
|
450
452
|
|
|
451
453
|
await store.persistWorkflowSnapshot({
|
|
@@ -524,6 +526,8 @@ describe('PostgresStore', () => {
|
|
|
524
526
|
suspendedPaths: {},
|
|
525
527
|
runId: runId,
|
|
526
528
|
timestamp: Date.now(),
|
|
529
|
+
serializedStepGraph: [],
|
|
530
|
+
status: 'running',
|
|
527
531
|
};
|
|
528
532
|
|
|
529
533
|
await store.persistWorkflowSnapshot({
|
package/src/storage/index.ts
CHANGED
|
@@ -20,7 +20,7 @@ import type {
|
|
|
20
20
|
WorkflowRuns,
|
|
21
21
|
PaginationArgs,
|
|
22
22
|
} from '@mastra/core/storage';
|
|
23
|
-
import { parseSqlIdentifier } from '@mastra/core/utils';
|
|
23
|
+
import { parseSqlIdentifier, parseFieldKey } from '@mastra/core/utils';
|
|
24
24
|
import type { WorkflowRunState } from '@mastra/core/workflows';
|
|
25
25
|
import pgPromise from 'pg-promise';
|
|
26
26
|
import type { ISSLConfig } from 'pg-promise/typescript/pg-subset';
|
|
@@ -220,14 +220,14 @@ export class PostgresStore extends MastraStorage {
|
|
|
220
220
|
}
|
|
221
221
|
if (attributes) {
|
|
222
222
|
Object.entries(attributes).forEach(([key, value]) => {
|
|
223
|
-
const parsedKey =
|
|
223
|
+
const parsedKey = parseFieldKey(key);
|
|
224
224
|
conditions.push(`attributes->>'${parsedKey}' = $${paramIndex++}`);
|
|
225
225
|
queryParams.push(value);
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
if (filters) {
|
|
229
229
|
Object.entries(filters).forEach(([key, value]) => {
|
|
230
|
-
const parsedKey =
|
|
230
|
+
const parsedKey = parseFieldKey(key);
|
|
231
231
|
conditions.push(`"${parsedKey}" = $${paramIndex++}`); // Ensure filter keys are quoted if they are column names
|
|
232
232
|
queryParams.push(value);
|
|
233
233
|
});
|