From 42e6cdaffc5242cb32a66c89872a0e058a267c0d Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 13 Jan 2024 16:44:30 +0100 Subject: [PATCH] db: Allow specifying the database name in config --- obsbot/db.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/obsbot/db.py b/obsbot/db.py index cdb084a..3f17fc7 100644 --- a/obsbot/db.py +++ b/obsbot/db.py @@ -19,7 +19,12 @@ def __init__(self): async def connect(self, config): logger.info(f'Connecting to database {config["host"]}:{config["port"]} as "{config["user"]}"...') self.conn = await asyncpg.create_pool( - host=config['host'], port=config['port'], user=config['user'], password=config['pass'], command_timeout=60 + host=config['host'], + port=config['port'], + user=config['user'], + password=config['pass'], + database=config['database'], + command_timeout=60, ) async def query(self, query, *args, **kwargs) -> Union[List[asyncpg.Record], None]: