fetches plans so far, TODO: prepare for going public: translate, comment
This commit is contained in:
23
builddb.py
Normal file
23
builddb.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import sqlite3
|
||||
|
||||
con = sqlite3.connect('repertoire.db')
|
||||
cursor = con.cursor()
|
||||
|
||||
def execute_sql_from_file(filename, cursor):
|
||||
with open(filename) as sqlfile:
|
||||
sqlcommands = sqlfile.read()
|
||||
list_of_commands = sqlcommands.split(';')
|
||||
for command in list_of_commands:
|
||||
cursor.execute(command)
|
||||
|
||||
|
||||
execute_sql_from_file('repertoire.sql', cursor)
|
||||
execute_sql_from_file('komponist_innen.sql', cursor)
|
||||
execute_sql_from_file('Werk.sql', cursor)
|
||||
execute_sql_from_file('Satz.sql', cursor)
|
||||
|
||||
con.commit()
|
||||
|
||||
# cursor.execute('COMMIT')
|
||||
|
||||
con.close()
|
||||
Reference in New Issue
Block a user