2023-10-08 21:46:31 +02:00
|
|
|
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)
|
2023-10-11 06:49:24 +02:00
|
|
|
execute_sql_from_file('composer.sql', cursor)
|
2023-10-13 06:39:44 +02:00
|
|
|
execute_sql_from_file('work.sql', cursor)
|
2023-10-18 06:44:39 +02:00
|
|
|
execute_sql_from_file('movement.sql', cursor)
|
2023-10-08 21:46:31 +02:00
|
|
|
|
|
|
|
|
con.commit()
|
|
|
|
|
|
|
|
|
|
# cursor.execute('COMMIT')
|
|
|
|
|
|
|
|
|
|
con.close()
|