def overall_player_stats(c, player): row = query_row(c, '''SELECT name, games_played, games_won, total_score, best_xl, best_score, first_game_start, last_game_end FROM players WHERE name = %s''', player) return fixup_player_stats(c, list(row))
def overall_player_stats(c, player): row = query_row( c, '''SELECT name, games_played, games_won, total_score, best_xl, best_score, first_game_start, last_game_end FROM players WHERE name = %s''', player) return fixup_player_stats(c, list(row))
def overall_player_stats(c, player): row = query_row( c, '''SELECT name, games_played, games_won, total_score, best_xl, best_score, first_game_start, last_game_end FROM players WHERE name = %s''', player) if row is None: raise crawl_utils.ScoringException( "Non-existent player '%s': interrupt during bulk import?" % player) else: return fixup_player_stats(c, list(row))
def worst_xl_rune_find(c): row = query_row(c, '''SELECT xl, rune_time FROM low_xl_rune_finds ORDER BY xl DESC, rune_time DESC LIMIT 1''') return (row[0], row[1])
def canonicalize_player_name(c, player): row = query_row(c, '''SELECT name FROM players WHERE name = %s''', player) if row: return row[0] return None
def find_streak_breaker(c, sid): return row_to_xdict( query_row(c, game_select_from('streak_breakers') + " WHERE streak_id = %s", sid))
def player_last_game(c, player): return (row_to_xdict( query_row(c, 'SELECT ' + scload.LOG_DB_SCOLUMNS + ''' FROM player_last_games WHERE name = %s''', player)))
def player_best_game(c, player): return (row_to_xdict( query_row(c, 'SELECT ' + scload.LOG_DB_SCOLUMNS + ''' FROM player_best_games WHERE name = %s ORDER BY sc DESC LIMIT 1''', player)))
def find_streak_breaker(c, sid): return row_to_xdict( query_row( c, game_select_from('streak_breakers') + " WHERE streak_id = %s", sid))
def player_last_game(c, player): return (row_to_xdict( query_row( c, 'SELECT ' + scload.LOG_DB_SCOLUMNS + ''' FROM player_last_games WHERE name = %s''', player)))
def player_best_game(c, player): return (row_to_xdict( query_row( c, 'SELECT ' + scload.LOG_DB_SCOLUMNS + ''' FROM player_best_games WHERE name = %s ORDER BY sc DESC LIMIT 1''', player)))
def worst_xl_rune_find(c): row = query_row( c, '''SELECT xl, rune_time FROM low_xl_rune_finds ORDER BY xl DESC, rune_time DESC LIMIT 1''') return (row[0], row[1])