Completed initdb.py script for setting up database

before starting backend.py
main
Anorak_1 2022-10-30 16:17:20 +01:00
parent ea55ed7205
commit df16921a3c
1 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,10 @@
import sqlite3 import sqlite3
sqlite3.connect("leaderboard.db") # RUN THIS FILE ONLY ONCE BEFORE STARTING THE API
dbcon = sqlite3.connect("leaderboard.db")
db = dbcon.cursor()
db.execute('''CREATE TABLE IF NOT EXISTS leaderboard([time_id] INTEGER PRIMARY KEY, [time_username] TEXT, [time_time] REAL, [time_map] TEXT, [time_gamever] TEXT)''')
dbcon.commit()