DB config

This commit is contained in:
Manuel Weiser 2024-05-11 10:10:25 +02:00
parent 0fa40f403f
commit 592866e27c

View File

@ -8,7 +8,6 @@ import sqlite3
db_file = "/www/wwwroot/www.manuelw.de/ebike/ebike.db" db_file = "/www/wwwroot/www.manuelw.de/ebike/ebike.db"
fitFilesCount = 0
try: try:
loading = sys.argv[1] loading = sys.argv[1]
@ -27,7 +26,13 @@ def main():
print("Connected to SQLite") print("Connected to SQLite")
updateLast(cursor) updateLast(cursor)
db.commit()
print("Data updated successfully into bike_loading table")
insertNew(cursor) insertNew(cursor)
db.commit()
print("Data inserted successfully into bike_drives table")
cursor.close()
except sqlite3.Error as error: except sqlite3.Error as error:
print("Failed to insert data into sqlite table", error) print("Failed to insert data into sqlite table", error)
@ -81,8 +86,6 @@ def updateLast(cursor):
WHERE id = ? WHERE id = ?
''' '''
cursor.execute(sql, data) cursor.execute(sql, data)
db.commit()
print("Data updated successfully into bike_loading table")
def insertNew(cursor): def insertNew(cursor):
@ -98,9 +101,6 @@ def insertNew(cursor):
''' '''
cursor.execute(sql, data) cursor.execute(sql, data)
db.commit()
print("Data inserted successfully into bike_drives table")
cursor.close()
if __name__ == '__main__': if __name__ == '__main__':