def get_round(rid, game): d.execute("SELECT * FROM round WHERE round={} AND game={}".format( rid, game)) rs = d.fetchone() if rs is None: return new_round(rid, game) return rs
def get_game(game_id): d.execute("SELECT * FROM game WHERE code='{}'".format(game_id)) return d.fetchone()
def get_question(qid): d.execute("SELECT * FROM prompt WHERE id={}".format(qid)) return d.fetchone()
def get_round_id(rid): d.execute("SELECT * FROM round WHERE id={}".format(rid)) return d.fetchone()
def is_alien(pid): d.execute("SELECT alien FROM player WHERE id={}".format(pid)) return d.fetchone()["alien"] == 1
def get_player_info(player_id): d.execute("SELECT * FROM player WHERE id={}".format(player_id)) return d.fetchone()
def get_game_info(player_id): d.execute( "select * from game where id=(select game from player where id={})". format(player_id)) return d.fetchone()