Re-add vaccum
This commit is contained in:
parent
503b26403c
commit
ee4332bd81
|
@ -0,0 +1,18 @@
|
||||||
|
#!/usr/bin/python3
|
||||||
|
import sqlite3
|
||||||
|
import os
|
||||||
|
|
||||||
|
def get_db_connection():
|
||||||
|
conn = sqlite3.connect("database.db")
|
||||||
|
conn.row_factory = sqlite3.Row
|
||||||
|
return conn
|
||||||
|
|
||||||
|
if os.path.exists("database.db"):
|
||||||
|
print("[INFO] Vacuuming...")
|
||||||
|
conn = get_db_connection()
|
||||||
|
conn.execute("VACUUM")
|
||||||
|
conn.commit()
|
||||||
|
conn.close()
|
||||||
|
print("[INFO] Success")
|
||||||
|
else:
|
||||||
|
print("[ERROR] Database not found")
|
Loading…
Reference in New Issue