Files

24 lines
550 B
Python
Raw Permalink Normal View History

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('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)
con.commit()
# cursor.execute('COMMIT')
con.close()