diff --git a/python/orm/common.py b/python/orm/common.py index 1214346..2b42564 100644 --- a/python/orm/common.py +++ b/python/orm/common.py @@ -36,6 +36,7 @@ def get_postgres_engine( name: str = "POSTGRES", pool_pre_ping: bool = True, vector_engine: bool = False, + pool_size: int = 8, ) -> Engine: """Create a SQLAlchemy engine from environment variables. @@ -45,6 +46,7 @@ def get_postgres_engine( This fixes the issue of trying to use a conection that has timed out on the database side. vector_engine (bool, optional): Whether to use the vector search schema. Defaults to False. This updates the search path the incldued the vecore types and operators. + pool_size (int, optional): Number of connections to keep in the pool. Defaults to 8. Returns: Engine: The SQLAlchemy engine. @@ -70,4 +72,5 @@ def get_postgres_engine( pool_pre_ping=pool_pre_ping, pool_recycle=1800, connect_args=connect_args, + pool_size=pool_size, )