async def METHOD_NAME(url: str, *args, **kwargs) -> asyncpg.Connection:
    """Return a connection to the database.
    This also sets the jsonb codec to use the json module.
    """
    try:
        conn = await asyncpg.METHOD_NAME(dsn=url, *args, **kwargs)
    except Exception as _:
        raise Exception("Database connection failed")
    try:
        await conn.set_type_codec("jsonb", encoder=json.dumps, decoder=json.loads, schema="pg_catalog")
    except Exception as _:
        raise Exception("Failed to set jsonb codec")
    return conn