From a223e6f0705ec0d788205ae6c996919d5d0258d1 Mon Sep 17 00:00:00 2001 From: Kane Norman <51185594+kanenorman@users.noreply.github.com> Date: Tue, 15 Oct 2024 04:02:44 -0500 Subject: [PATCH] docs: explain different connection string formats in the docstring (#1132) * feat: specify individual connection parameters * style: fix excessive line length * test: correct env variables * docs: update PgvectorDocumentStore docstring Co-authored-by: David S. Batista * style: reorder parameters * style: reorder parameters * revert: remove individual connection params * docs: update postgres connection string docs --------- Co-authored-by: David S. Batista --- .../document_stores/pgvector/document_store.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py b/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py index a02c46200..1b1333f5c 100644 --- a/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py +++ b/integrations/pgvector/src/haystack_integrations/document_stores/pgvector/document_store.py @@ -96,7 +96,11 @@ def __init__( A specific table to store Haystack documents will be created if it doesn't exist yet. :param connection_string: The connection string to use to connect to the PostgreSQL database, defined as an - environment variable, e.g.: `PG_CONN_STR="postgresql://USER:PASSWORD@HOST:PORT/DB_NAME"` + environment variable. It can be provided in either URI format + e.g.: `PG_CONN_STR="postgresql://USER:PASSWORD@HOST:PORT/DB_NAME"`, or keyword/value format + e.g.: `PG_CONN_STR="host=HOST port=PORT dbname=DBNAME user=USER password=PASSWORD"` + See [PostgreSQL Documentation](https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING) + for more details. :param table_name: The name of the table to use to store Haystack documents. :param language: The language to be used to parse query and document content in keyword retrieval. To see the list of available languages, you can run the following SQL query in your PostgreSQL database: