@mastra/pg 0.10.2-alpha.2 → 0.10.2-alpha.3

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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/pg@0.10.2-alpha.2 build /home/runner/work/mastra/mastra/stores/pg
2
+ > @mastra/pg@0.10.2-alpha.3 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
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.5.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 10152ms
9
+ TSC ⚡️ Build success in 10698ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.3
13
13
  Writing package typings: /home/runner/work/mastra/mastra/stores/pg/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.3
15
15
  Writing package typings: /home/runner/work/mastra/mastra/stores/pg/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 12410ms
16
+ DTS ⚡️ Build success in 10174ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
20
  ESM dist/index.js 67.23 KB
21
- ESM ⚡️ Build success in 1748ms
21
+ ESM ⚡️ Build success in 1908ms
22
22
  CJS dist/index.cjs 67.79 KB
23
- CJS ⚡️ Build success in 1748ms
23
+ CJS ⚡️ Build success in 1909ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @mastra/pg
2
2
 
3
+ ## 0.10.2-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - e0f9201: change how dedupe works for libsql and pg
8
+ - Updated dependencies [925ab94]
9
+ - @mastra/core@0.10.4-alpha.3
10
+
3
11
  ## 0.10.2-alpha.2
4
12
 
5
13
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1485,15 +1485,12 @@ var PostgresStore = class extends storage.MastraStorage {
1485
1485
  }
1486
1486
  const finalQuery = unionQueries.join(" UNION ALL ") + ' ORDER BY "createdAt" ASC';
1487
1487
  const includedRows = await this.db.manyOrNone(finalQuery, params);
1488
- const dedupedRows = Object.values(
1489
- includedRows.reduce(
1490
- (acc, row) => {
1491
- acc[row.id] = row;
1492
- return acc;
1493
- },
1494
- {}
1495
- )
1496
- );
1488
+ const seen = /* @__PURE__ */ new Set();
1489
+ const dedupedRows = includedRows.filter((row) => {
1490
+ if (seen.has(row.id)) return false;
1491
+ seen.add(row.id);
1492
+ return true;
1493
+ });
1497
1494
  rows = dedupedRows;
1498
1495
  } else {
1499
1496
  const limit = typeof selectBy?.last === `number` ? selectBy.last : 40;
package/dist/index.js CHANGED
@@ -1477,15 +1477,12 @@ var PostgresStore = class extends MastraStorage {
1477
1477
  }
1478
1478
  const finalQuery = unionQueries.join(" UNION ALL ") + ' ORDER BY "createdAt" ASC';
1479
1479
  const includedRows = await this.db.manyOrNone(finalQuery, params);
1480
- const dedupedRows = Object.values(
1481
- includedRows.reduce(
1482
- (acc, row) => {
1483
- acc[row.id] = row;
1484
- return acc;
1485
- },
1486
- {}
1487
- )
1488
- );
1480
+ const seen = /* @__PURE__ */ new Set();
1481
+ const dedupedRows = includedRows.filter((row) => {
1482
+ if (seen.has(row.id)) return false;
1483
+ seen.add(row.id);
1484
+ return true;
1485
+ });
1489
1486
  rows = dedupedRows;
1490
1487
  } else {
1491
1488
  const limit = typeof selectBy?.last === `number` ? selectBy.last : 40;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/pg",
3
- "version": "0.10.2-alpha.2",
3
+ "version": "0.10.2-alpha.3",
4
4
  "description": "Postgres provider for Mastra - includes both vector and db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,8 +34,8 @@
34
34
  "typescript": "^5.8.2",
35
35
  "vitest": "^3.2.2",
36
36
  "@internal/lint": "0.0.10",
37
- "@mastra/core": "0.10.4-alpha.2",
38
- "@internal/storage-test-utils": "0.0.6"
37
+ "@internal/storage-test-utils": "0.0.6",
38
+ "@mastra/core": "0.10.4-alpha.3"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "@mastra/core": "^0.10.2-alpha.0"
@@ -761,15 +761,12 @@ export class PostgresStore extends MastraStorage {
761
761
  }
762
762
  const finalQuery = unionQueries.join(' UNION ALL ') + ' ORDER BY "createdAt" ASC';
763
763
  const includedRows = await this.db.manyOrNone(finalQuery, params);
764
- const dedupedRows = Object.values(
765
- includedRows.reduce(
766
- (acc, row) => {
767
- acc[row.id] = row;
768
- return acc;
769
- },
770
- {} as Record<string, (typeof includedRows)[0]>,
771
- ),
772
- );
764
+ const seen = new Set<string>();
765
+ const dedupedRows = includedRows.filter(row => {
766
+ if (seen.has(row.id)) return false;
767
+ seen.add(row.id);
768
+ return true;
769
+ });
773
770
  rows = dedupedRows;
774
771
  } else {
775
772
  const limit = typeof selectBy?.last === `number` ? selectBy.last : 40;