Added delete to helper script
This commit is contained in:
parent
481e579b59
commit
9b8ba01df2
22
database.py
22
database.py
@ -1,9 +1,30 @@
|
||||
import sqlite3
|
||||
from pathlib import Path # creating folders
|
||||
import sys
|
||||
|
||||
conn = sqlite3.connect('app.db')
|
||||
cursor = conn.cursor()
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
|
||||
cursor.execute('DELETE FROM sets where u_id="' +sys.argv[1]+ '";')
|
||||
conn.commit()
|
||||
|
||||
cursor.execute('DELETE FROM inventory where u_id="' +sys.argv[1]+ '";')
|
||||
conn.commit()
|
||||
|
||||
cursor.execute('DELETE FROM minifigures where u_id="' +sys.argv[1]+ '";')
|
||||
conn.commit()
|
||||
|
||||
cursor.execute('DELETE FROM missing where u_id="' +sys.argv[1]+ '";')
|
||||
conn.commit()
|
||||
|
||||
cursor.close()
|
||||
conn.close()
|
||||
|
||||
exit()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -40,6 +61,7 @@ cursor.execute('''CREATE TABLE IF NOT EXISTS inventory (
|
||||
)''')
|
||||
|
||||
cursor.execute('''CREATE TABLE IF NOT EXISTS minifigures (
|
||||
fig_num TEXT,
|
||||
set_num TEXT,
|
||||
name TEXT,
|
||||
quantity INTEGER,
|
||||
|
Loading…
Reference in New Issue
Block a user