@@ -79,20 +79,20 @@ def setupDB():
def fillDB(tournaments,players):
cursor=connection.cursor()
cursor.execute("""delete from players_performance""")
cursor.execute("""delete from players""")
cursor.execute("""delete from tournaments""")
cursor.executemany(
"""insert into tournaments (code,datum,class,round_count,player_count,country_code,description) values (:code,:date,:class,:roundCount,:playerCount,:countryCode,:description)""",
tournaments.values()
)
cursor.executemany("""insert or ignore into players (pin,name) values (:pin,:name)""", players)
cursor.executemany("""insert or replace into players (pin,name) values (:pin,:name)""", players)
"""insert into players_performance (pin,tournament_code,country_code,club,win_count,game_count,rating_before,rating_after) values (:pin,:tournamentCode,:countryCode,:club,:winCount,:gameCount,:rating1,:rating2)""",
players
connection.commit()
@@ -16,29 +16,31 @@ Uložené dotazy.
* (text) class
* (integer) round_count
* (integer) player_count
* (text) country_code
* (text) description
### players
* (integer) pin
* (text) name
### players_performance
Co se vztahuje zároveň k hráči a k turnaji. Většina položek all.hst.
* (text) tournament_code
* (text) club
* (integer) win_count
* (integer) game_count
* (real) rating_before
* (real) rating_after
### players_performance_tournaments
Pohled na tournaments a players_performance.
* (text) p_country_code - země hráče
* (text) t_country_code - lokace turnaje
* (text) datum
Status change: