Skip to content

Commit

Permalink
db: Allow specifying the database name in config
Browse files Browse the repository at this point in the history
  • Loading branch information
derrod committed Jan 13, 2024
1 parent ad6ab49 commit 42e6cda
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion obsbot/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit 42e6cda

Please sign in to comment.