Skip to content

Commit dab4c99

Browse files
Allow port to be configured in Connection.
1 parent 715bb23 commit dab4c99

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

db_wrapper/connection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class ConnectionParameters:
2424
"""Defines connection parameters for database."""
2525

2626
host: str
27+
port: int
2728
user: str
2829
password: str
2930
database: str
@@ -37,8 +38,9 @@ async def _try_connect(
3738
user = connection_params.user
3839
password = connection_params.password
3940
host = connection_params.host
41+
port = connection_params.port
4042

41-
dsn = f'dbname={database} user={user} password={password} host={host}'
43+
dsn = f'dbname={database} user={user} password={password} host={host} port={port}'
4244

4345
# PENDS python 3.9 support in pylint
4446
# pylint: disable=unsubscriptable-object

0 commit comments

Comments
 (0)