Answer the question
In order to leave comments, you need to log in
Why can't I connect to user PostgreSQL?
I'm trying to create a Telegram bot using the aiogram library. It came down to creating a database. Initially I wanted to use SQLite, but I found information that it is better to use PostgreSQL, since it has asynchronous connectors and one of the best libraries for this at the moment is asyncpg. I installed PostgreSQL and PgAdmin4 on my PC (Windows 10). Created Usera and base for it as specified here .
However, when connecting to the database by code:
class PgDatabase:
def __init__(self, loop: asyncio.AbstractEventLoop):
self.pool: asyncpg.pool.Pool = loop.run_until_complete(
asyncpg.create_pool(
user=PgUser,
password=PgPassword,
host="localhost"
)
)
test_connect = PgDatabase(loop=asyncio.get_event_loop())
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question