Skip to content

Commit b7f0d9f

Browse files
committed
Fix engine compatibility
1 parent e2cfb8b commit b7f0d9f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

psqlpy_piccolo/engine.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,8 @@ async def start_connection_pool(self: Self, **kwargs: Dict[str, Any]) -> None:
531531
config = dict(self.config)
532532
config.update(**kwargs)
533533
self.pool = ConnectionPool(
534+
db_name=config.pop("database", None),
535+
username=config.pop("user", None),
534536
max_db_pool_size=config.pop("max_size"),
535537
**config,
536538
)
@@ -545,11 +547,13 @@ async def close_connection_pool(self) -> None:
545547

546548
async def get_new_connection(self) -> Connection:
547549
"""Returns a new connection - doesn't retrieve it from the pool."""
550+
config = dict(self.config)
548551
return await (
549552
ConnectionPool(
550-
db_name=self.config.pop("database", None),
551-
username=self.config.pop("user", None),
552-
**self.config,
553+
db_name=config.pop("database", None),
554+
username=config.pop("user", None),
555+
max_db_pool_size=config.pop("max_size"),
556+
**config,
553557
)
554558
).connection()
555559

0 commit comments

Comments
 (0)