forked from acm-ndsu/byte_le_engine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
db_viewer.py
67 lines (49 loc) · 1.02 KB
/
db_viewer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import sqlite3
import pandas as pd
def read_table(table: str):
"""
Returns the entire table given the table's name.
:param table:
"""
with sqlite3.connect('byte_server.db') as db:
return pd.read_sql_query(f'SELECT * FROM {table}', db)
def tournaments():
"""
Returns Tournaments table.
"""
return read_table('tournament')
def teams():
"""
Returns Teams table.
"""
return read_table('team')
def runs():
"""
Returns Run table.
"""
return read_table('run')
def turns():
"""
Returns Turns table.
"""
return read_table('turn')
def submissions():
"""
Returns Submissions table.
"""
return read_table('submission')
def universities():
"""
Returns Universities table.
"""
return read_table('university')
def team_types():
"""
Returns Team Types table.
"""
return read_table('team_type')
def submission_run_infos():
"""
Returns Run table.
"""
return read_table('submission_run_info')