optimize cmd history
This commit is contained in:
@@ -72,9 +72,11 @@ def createFilterTable(file):
|
||||
print("db connection:",connection.total_changes)
|
||||
def addFineFilter(file,table,filterstr):
|
||||
with sqlite3.connect(file) as connection:
|
||||
cmd = f"""INSERT INTO {table}(cmd) VALUES(?);"""
|
||||
cmd_createFineFilter = f"""INSERT INTO {table}(cmd) VALUES(?);"""
|
||||
cmd_checkIfExists = f"""SELECT * FROM {table} WHERE cmd = ?"""
|
||||
cursor = connection.cursor()
|
||||
cursor.execute(cmd,(filterstr,))
|
||||
if cursor.execute(cmd_checkIfExists,(filterstr,)).fetchone() == None:
|
||||
cursor.execute(cmd_createFineFilter,(filterstr,))
|
||||
|
||||
def writedb(jobs):
|
||||
with sqlite3.connect("../db/sqlite3.db") as connection:
|
||||
|
||||
Reference in New Issue
Block a user