@mastra/pg 0.15.0-alpha.1 → 0.15.1-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/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @mastra/pg
2
2
 
3
+ ## 0.15.1-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix PgVector listIndexes() to only return Mastra-managed tables instead of all tables with vector columns. This prevents initialization failures when other pgvector tables exist in the database. ([#7539](https://github.com/mastra-ai/mastra/pull/7539))
8
+
9
+ - Updated dependencies [[`0662d02`](https://github.com/mastra-ai/mastra/commit/0662d02ef16916e67531890639fcd72c69cfb6e2), [`6189844`](https://github.com/mastra-ai/mastra/commit/61898448e65bda02bb814fb15801a89dc6476938), [`d7a8f59`](https://github.com/mastra-ai/mastra/commit/d7a8f59154b0621aec4f41a6b2ea2b3882f03cb7), [`4dda259`](https://github.com/mastra-ai/mastra/commit/4dda2593b6343f9258671de5fb237aeba3ef6bb7), [`defed1c`](https://github.com/mastra-ai/mastra/commit/defed1ca8040cc8d42e645c5a50a1bc52a4918d7), [`6991ced`](https://github.com/mastra-ai/mastra/commit/6991cedcb5a44a49d9fe58ef67926e1f96ba55b1), [`9cb9c42`](https://github.com/mastra-ai/mastra/commit/9cb9c422854ee81074989dd2d8dccc0500ba8d3e), [`8334859`](https://github.com/mastra-ai/mastra/commit/83348594d4f37b311ba4a94d679c5f8721d796d4)]:
10
+ - @mastra/core@0.16.1-alpha.0
11
+
12
+ ## 0.15.0
13
+
14
+ ### Minor Changes
15
+
16
+ - 376913a: Update peerdeps of @mastra/core
17
+
18
+ ### Patch Changes
19
+
20
+ - 6f5eb7a: Throw if an empty or whitespace-only threadId is passed when getting messages
21
+ - Updated dependencies [8fbf79e]
22
+ - Updated dependencies [fd83526]
23
+ - Updated dependencies [d0b90ab]
24
+ - Updated dependencies [6f5eb7a]
25
+ - Updated dependencies [a01cf14]
26
+ - Updated dependencies [a9e50ee]
27
+ - Updated dependencies [5397eb4]
28
+ - Updated dependencies [c9f4e4a]
29
+ - Updated dependencies [0acbc80]
30
+ - @mastra/core@0.16.0
31
+
3
32
  ## 0.15.0-alpha.1
4
33
 
5
34
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -845,14 +845,37 @@ var PgVector = class extends vector.MastraVector {
845
845
  async listIndexes() {
846
846
  const client = await this.pool.connect();
847
847
  try {
848
- const vectorTablesQuery = `
849
- SELECT DISTINCT table_name
850
- FROM information_schema.columns
851
- WHERE table_schema = $1
852
- AND udt_name = 'vector';
853
- `;
854
- const vectorTables = await client.query(vectorTablesQuery, [this.schema || "public"]);
855
- return vectorTables.rows.map((row) => row.table_name);
848
+ const mastraTablesQuery = `
849
+ SELECT DISTINCT t.table_name
850
+ FROM information_schema.tables t
851
+ WHERE t.table_schema = $1
852
+ AND EXISTS (
853
+ SELECT 1
854
+ FROM information_schema.columns c
855
+ WHERE c.table_schema = t.table_schema
856
+ AND c.table_name = t.table_name
857
+ AND c.column_name = 'vector_id'
858
+ AND c.data_type = 'text'
859
+ )
860
+ AND EXISTS (
861
+ SELECT 1
862
+ FROM information_schema.columns c
863
+ WHERE c.table_schema = t.table_schema
864
+ AND c.table_name = t.table_name
865
+ AND c.column_name = 'embedding'
866
+ AND c.udt_name = 'vector'
867
+ )
868
+ AND EXISTS (
869
+ SELECT 1
870
+ FROM information_schema.columns c
871
+ WHERE c.table_schema = t.table_schema
872
+ AND c.table_name = t.table_name
873
+ AND c.column_name = 'metadata'
874
+ AND c.data_type = 'jsonb'
875
+ );
876
+ `;
877
+ const mastraTables = await client.query(mastraTablesQuery, [this.schema || "public"]);
878
+ return mastraTables.rows.map((row) => row.table_name);
856
879
  } catch (e) {
857
880
  const mastraError = new error.MastraError(
858
881
  {