pgvector-haystack 5.2.1__py3-none-any.whl → 5.3.0__py3-none-any.whl

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.
@@ -987,6 +987,38 @@ class PgvectorDocumentStore:
987
987
  error_msg="Could not delete documents from PgvectorDocumentStore",
988
988
  )
989
989
 
990
+ def delete_all_documents(self) -> None:
991
+ """
992
+ Deletes all documents in the document store.
993
+ """
994
+ query = SQL("TRUNCATE TABLE {schema_name}.{table_name}").format(
995
+ schema_name=Identifier(self.schema_name),
996
+ table_name=Identifier(self.table_name),
997
+ )
998
+
999
+ self._ensure_db_setup()
1000
+ assert self._cursor is not None
1001
+ self._execute_sql(
1002
+ cursor=self._cursor, sql_query=query, error_msg="Could not delete all documents from PgvectorDocumentStore"
1003
+ )
1004
+
1005
+ async def delete_all_documents_async(self) -> None:
1006
+ """
1007
+ Asynchronously deletes all documents in the document store.
1008
+ """
1009
+ query = SQL("TRUNCATE TABLE {schema_name}.{table_name}").format(
1010
+ schema_name=Identifier(self.schema_name),
1011
+ table_name=Identifier(self.table_name),
1012
+ )
1013
+
1014
+ await self._ensure_db_setup_async()
1015
+ assert self._async_cursor is not None
1016
+ await self._execute_sql_async(
1017
+ cursor=self._async_cursor,
1018
+ sql_query=query,
1019
+ error_msg="Could not delete all documents from PgvectorDocumentStore",
1020
+ )
1021
+
990
1022
  def _build_keyword_retrieval_query(
991
1023
  self, query: str, top_k: int, filters: Optional[Dict[str, Any]] = None
992
1024
  ) -> Tuple[Composed, tuple]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pgvector-haystack
3
- Version: 5.2.1
3
+ Version: 5.3.0
4
4
  Summary: An integration of pgvector (vector search extension for Postgres) with Haystack
5
5
  Project-URL: Source, https://github.com/deepset-ai/haystack-core-integrations
6
6
  Project-URL: Documentation, https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/pgvector/README.md
@@ -29,34 +29,16 @@ Description-Content-Type: text/markdown
29
29
  [![PyPI - Version](https://img.shields.io/pypi/v/pgvector-haystack.svg)](https://pypi.org/project/pgvector-haystack)
30
30
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pgvector-haystack.svg)](https://pypi.org/project/pgvector-haystack)
31
31
 
32
- ---
32
+ - [Integration page](https://haystack.deepset.ai/integrations/pgvector-documentstore)
33
+ - [Changelog](https://github.com/deepset-ai/haystack-core-integrations/blob/main/integrations/pgvector/CHANGELOG.md)
33
34
 
34
- **Table of Contents**
35
+ ---
35
36
 
36
- - [pgvector-haystack](#pgvector-haystack)
37
- - [Installation](#installation)
38
- - [Testing](#testing)
39
- - [License](#license)
37
+ Refer to the general [Contribution Guidelines](https://github.com/deepset-ai/haystack-core-integrations/blob/main/CONTRIBUTING.md).
40
38
 
41
- ## Installation
39
+ To run integration tests locally, you need to have a PostgreSQL DB running with the `pgvector` extension.
40
+ You can start it using Docker:
42
41
 
43
42
  ```console
44
- pip install pgvector-haystack
45
- ```
46
-
47
- ## Testing
48
-
49
- Ensure that you have a PostgreSQL running with the `pgvector` extension. For a quick setup using Docker, run:
50
- ```
51
43
  docker run -d -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres pgvector/pgvector:pg17
52
44
  ```
53
-
54
- then run the tests:
55
-
56
- ```console
57
- hatch run test:all
58
- ```
59
-
60
- ## License
61
-
62
- `pgvector-haystack` is distributed under the terms of the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license.
@@ -5,9 +5,9 @@ haystack_integrations/components/retrievers/pgvector/keyword_retriever.py,sha256
5
5
  haystack_integrations/document_stores/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  haystack_integrations/document_stores/pgvector/__init__.py,sha256=Ge-7ggarfr3x8UqNdFHUuFGiu52u49sOVe3l16WEwZU,197
7
7
  haystack_integrations/document_stores/pgvector/converters.py,sha256=9ORG_Yb8Ss4eGGJB9ZGaDE25z89rLAh3ZisKwRww1bw,2937
8
- haystack_integrations/document_stores/pgvector/document_store.py,sha256=ygLMX4Y73TPsqQUdpnvXTgkXpnyDHyeHKXrSFB27Jw0,49839
8
+ haystack_integrations/document_stores/pgvector/document_store.py,sha256=EKrDg-nezEaRhEYnVhlTH7wmJ_w4sy5IfaaNq6mITaY,51009
9
9
  haystack_integrations/document_stores/pgvector/filters.py,sha256=jYdoXJZhAn3hNZTnx1x8K5Ok2LZzh-GB4hOhk6r7ZPk,9021
10
- pgvector_haystack-5.2.1.dist-info/METADATA,sha256=o0Cjf0OCN1rbYeiilUFOYgJSI-XMzjNtO_D4csagW5Q,2187
11
- pgvector_haystack-5.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
- pgvector_haystack-5.2.1.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
13
- pgvector_haystack-5.2.1.dist-info/RECORD,,
10
+ pgvector_haystack-5.3.0.dist-info/METADATA,sha256=O_edb8lqV2SEZqbwb6Va_iC3Pu_p0GtxM_t95SEPNGo,2144
11
+ pgvector_haystack-5.3.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
12
+ pgvector_haystack-5.3.0.dist-info/licenses/LICENSE.txt,sha256=B05uMshqTA74s-0ltyHKI6yoPfJ3zYgQbvcXfDVGFf8,10280
13
+ pgvector_haystack-5.3.0.dist-info/RECORD,,