@mastra/pg 0.3.3-alpha.0 → 0.3.3-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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/pg@0.3.3-alpha.0 build /home/runner/work/mastra/mastra/stores/pg
2
+ > @mastra/pg@0.3.3-alpha.1 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.4.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 9786ms
9
+ TSC ⚡️ Build success in 10650ms
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 11880ms
16
+ DTS ⚡️ Build success in 11730ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
20
  CJS dist/index.cjs 55.37 KB
21
- CJS ⚡️ Build success in 1723ms
21
+ CJS ⚡️ Build success in 1714ms
22
22
  ESM dist/index.js 54.89 KB
23
- ESM ⚡️ Build success in 1723ms
23
+ ESM ⚡️ Build success in 1715ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @mastra/pg
2
2
 
3
+ ## 0.3.3-alpha.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [e450778]
8
+ - Updated dependencies [8902157]
9
+ - Updated dependencies [ca0dc88]
10
+ - Updated dependencies [9cd1a46]
11
+ - Updated dependencies [70dbf51]
12
+ - @mastra/core@0.9.3-alpha.1
13
+
3
14
  ## 0.3.3-alpha.0
4
15
 
5
16
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/pg",
3
- "version": "0.3.3-alpha.0",
3
+ "version": "0.3.3-alpha.1",
4
4
  "description": "Postgres provider for Mastra - includes both vector and db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,7 +24,7 @@
24
24
  "pg": "^8.13.3",
25
25
  "pg-promise": "^11.11.0",
26
26
  "xxhash-wasm": "^1.1.0",
27
- "@mastra/core": "^0.9.3-alpha.0"
27
+ "@mastra/core": "^0.9.3-alpha.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@microsoft/api-extractor": "^7.52.5",
@@ -1339,6 +1339,50 @@ describe('PgVector', () => {
1339
1339
  });
1340
1340
  });
1341
1341
 
1342
+ describe('Error Handling', () => {
1343
+ const testIndexName = 'test_index_error';
1344
+ beforeAll(async () => {
1345
+ await vectorDB.createIndex({ indexName: testIndexName, dimension: 3 });
1346
+ });
1347
+
1348
+ afterAll(async () => {
1349
+ await vectorDB.deleteIndex(testIndexName);
1350
+ });
1351
+
1352
+ it('should handle non-existent index queries', async () => {
1353
+ await expect(vectorDB.query({ indexName: 'non_existent_index_yu', queryVector: [1, 2, 3] })).rejects.toThrow();
1354
+ });
1355
+
1356
+ it('should handle invalid dimension vectors', async () => {
1357
+ const invalidVector = [1, 2, 3, 4]; // 4D vector for 3D index
1358
+ await expect(vectorDB.upsert({ indexName: testIndexName, vectors: [invalidVector] })).rejects.toThrow();
1359
+ });
1360
+
1361
+ it('should handle duplicate index creation gracefully', async () => {
1362
+ const duplicateIndexName = `duplicate_test`;
1363
+ const dimension = 768;
1364
+
1365
+ // Create index first time
1366
+ await vectorDB.createIndex({
1367
+ indexName: duplicateIndexName,
1368
+ dimension,
1369
+ metric: 'cosine',
1370
+ });
1371
+
1372
+ // Try to create with same dimensions - should not throw
1373
+ await expect(
1374
+ vectorDB.createIndex({
1375
+ indexName: duplicateIndexName,
1376
+ dimension,
1377
+ metric: 'cosine',
1378
+ }),
1379
+ ).resolves.not.toThrow();
1380
+
1381
+ // Cleanup
1382
+ await vectorDB.deleteIndex(duplicateIndexName);
1383
+ });
1384
+ });
1385
+
1342
1386
  describe('Edge Cases and Special Values', () => {
1343
1387
  // Additional Edge Cases
1344
1388
  it('should handle empty result sets with valid filters', async () => {