From 84456b10f59e80e61c18f5883b207b8390e5478f Mon Sep 17 00:00:00 2001 From: shaharuk-yb Date: Tue, 7 Jan 2025 15:41:21 +0530 Subject: [PATCH 1/2] add support to provide custom port in pgvector --- vectordb_bench/backend/clients/pgvector/cli.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vectordb_bench/backend/clients/pgvector/cli.py b/vectordb_bench/backend/clients/pgvector/cli.py index 43385ee6..de001c2d 100644 --- a/vectordb_bench/backend/clients/pgvector/cli.py +++ b/vectordb_bench/backend/clients/pgvector/cli.py @@ -43,6 +43,15 @@ class PgVectorTypedDict(CommonTypedDict): host: Annotated[ str, click.option("--host", type=str, help="Db host", required=True) ] + port: Annotated[ + int, + click.option("--port", + type=int, + help="Postgres database port", + default=5432, + required=False + ), + ] db_name: Annotated[ str, click.option("--db-name", type=str, help="Db name", required=True) ] @@ -130,6 +139,7 @@ def PgVectorIVFFlat( user_name=SecretStr(parameters["user_name"]), password=SecretStr(parameters["password"]), host=parameters["host"], + port=parameters["port"], db_name=parameters["db_name"], ), db_case_config=PgVectorIVFFlatConfig( @@ -164,6 +174,7 @@ def PgVectorHNSW( user_name=SecretStr(parameters["user_name"]), password=SecretStr(parameters["password"]), host=parameters["host"], + port=parameters["port"], db_name=parameters["db_name"], ), db_case_config=PgVectorHNSWConfig( From 970d8db5918fd35c01028d87ee908405e89039c3 Mon Sep 17 00:00:00 2001 From: shaharuk-yb Date: Tue, 7 Jan 2025 15:50:20 +0530 Subject: [PATCH 2/2] show_default=True --- vectordb_bench/backend/clients/pgvector/cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/vectordb_bench/backend/clients/pgvector/cli.py b/vectordb_bench/backend/clients/pgvector/cli.py index de001c2d..ef8914be 100644 --- a/vectordb_bench/backend/clients/pgvector/cli.py +++ b/vectordb_bench/backend/clients/pgvector/cli.py @@ -49,6 +49,7 @@ class PgVectorTypedDict(CommonTypedDict): type=int, help="Postgres database port", default=5432, + show_default=True, required=False ), ]