示例#1
0
def guild_get_by_id(gid) -> Optional[DbGuild]:
    c.execute("SELECT * FROM guilds WHERE id=?", (gid,))
    g = c.fetchone()
    return DbGuild(*g) if g else None
示例#2
0
def guild_get_by_faction_name(name) -> Optional[DbGuild]:
    c.execute("SELECT * FROM guilds WHERE faction_name=?", (name,))
    g = c.fetchone()
    return DbGuild(*g) if g else None
示例#3
0
def guild_get_all_factions() -> List[DbGuild]:
    c.execute("SELECT * FROM guilds WHERE faction_name IS NOT NULL ORDER BY faction_name")
    return [DbGuild(*g) for g in c.fetchall()]
示例#4
0
def guild_get_by_faction_alias(alias) -> Optional[DbGuild]:
    c.execute("SELECT * FROM guilds WHERE faction_alias=?", (alias,))
    g = c.fetchone()
    return DbGuild(*g) if g else None
示例#5
0
def guild_get_all() -> List[DbGuild]:
    c.execute("SELECT * FROM guilds")
    return [DbGuild(*g) for g in c.fetchall()]