postgres/utils.py
async def init_db():
    """Connect to database and create initial tables."""
    conn: asyncpg.Connection = await asyncpg.connect(Client.database_url)

    tables = Path("postgres", "tables")

    logger.info("Creating tables.")

    for table_file in tables.iterdir():
        await conn.execute(table_file.read_text())

    return conn
Connect to database and create initial tables.
Connect to database and create initial tables.
Connect to database and create initial tables .
async def init_db():
    conn: asyncpg.Connection = await asyncpg.connect(Client.database_url)
    tables = Path("postgres", "tables")
    logger.info("Creating tables.")
    for table_file in tables.iterdir():
        await conn.execute(table_file.read_text())
    return conn
async def init_db ( ) : conn : asyncpg . Connection = await asyncpg . connect ( Client . database_url ) tables = Path ( "postgres" , "tables" ) logger . info ( "Creating tables." ) for table_file in tables . iterdir ( ) : await conn . execute ( table_file . read_text ( ) ) return conn
Connect to database and create initial tables.
Connect to database and create initial tables .
"""Connect to database and create initial tables."""