async def get_post_id(db, author, permlink):
    """Get post_id based on author/permlink."""
    sql = "SELECT id FROM hive_posts WHERE author = :a AND permlink = :p"
    _id = await db.query_one(sql, a=author, p=permlink)
    assert _id, 'post id not found'
    return _id