Update use of sqlhelpers.insert_filler.
This commit is contained in:
parent
dfca0e96b6
commit
d3154e7b51
1 changed files with 6 additions and 6 deletions
|
@ -376,8 +376,8 @@ class TSDB:
|
||||||
'replaced_at': replaced_at,
|
'replaced_at': replaced_at,
|
||||||
}
|
}
|
||||||
cur = self.sql.cursor()
|
cur = self.sql.cursor()
|
||||||
(qmarks, bindings) = sqlhelpers.insert_filler(SQL_EDITS_COLUMNS, postdata)
|
(qmarks, bindings) = sqlhelpers.insert_filler(postdata)
|
||||||
query = 'INSERT INTO %s VALUES(%s)' % (table, qmarks)
|
query = f'INSERT INTO {table} {qmarks}'
|
||||||
cur.execute(query, bindings)
|
cur.execute(query, bindings)
|
||||||
|
|
||||||
def insert_submission(self, submission):
|
def insert_submission(self, submission):
|
||||||
|
@ -417,8 +417,8 @@ class TSDB:
|
||||||
'augmented_at': None,
|
'augmented_at': None,
|
||||||
'augmented_count': None,
|
'augmented_count': None,
|
||||||
}
|
}
|
||||||
(qmarks, bindings) = sqlhelpers.insert_filler(SQL_SUBMISSION_COLUMNS, postdata)
|
(qmarks, bindings) = sqlhelpers.insert_filler(postdata)
|
||||||
query = 'INSERT INTO submissions VALUES(%s)' % qmarks
|
query = f'INSERT INTO submissions {qmarks}'
|
||||||
cur.execute(query, bindings)
|
cur.execute(query, bindings)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -473,8 +473,8 @@ class TSDB:
|
||||||
'distinguish': comment.distinguished,
|
'distinguish': comment.distinguished,
|
||||||
'textlen': len(comment.body),
|
'textlen': len(comment.body),
|
||||||
}
|
}
|
||||||
(qmarks, bindings) = sqlhelpers.insert_filler(SQL_COMMENT_COLUMNS, postdata)
|
(qmarks, bindings) = sqlhelpers.insert_filler(postdata)
|
||||||
query = 'INSERT INTO comments VALUES(%s)' % qmarks
|
query = f'INSERT INTO comments {qmarks}'
|
||||||
cur.execute(query, bindings)
|
cur.execute(query, bindings)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue