summaryrefslogtreecommitdiff
path: root/framework/database.py
diff options
context:
space:
mode:
Diffstat (limited to 'framework/database.py')
-rw-r--r--framework/database.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/framework/database.py b/framework/database.py
index 6f899ba..e89a2e7 100644
--- a/framework/database.py
+++ b/framework/database.py
@@ -61,11 +61,8 @@ class ResultDatabase:
return date
def addPlaceholderResults(self, run, tests):
- #rows = [(run, test) for test in tests]
+ rows = [(run, test) for test in tests]
c = self.connection.cursor()
- #c.executemany('INSERT INTO results(run_id, test_name) VALUES(?,?)', rows)
- testlist = list(tests)
- batches = [testlist[x:x+500] for x in range(0, len(testlist), 500)]
- for batch in batches:
- query = 'INSERT INTO results(run_id, test_name) VALUES (' + '),('.join([str(run) + ',' + "'" + test.replace("'", '') + "'" for test in batch]) + ')'
- c.execute(query)
+ c.execute('BEGIN IMMEDIATE TRANSACTION')
+ c.executemany('INSERT INTO results(run_id, test_name) VALUES(?,?)', rows)
+ c.execute('END TRANSACTION')