diff options
author | Sam <me@samcday.com> | 2020-09-24 12:10:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-24 11:10:14 +0100 |
commit | a6700331cee70a3ca04c834efdc68cc2ef63947d (patch) | |
tree | 10420639a2a4685b2562ff1d106d1ae9a11712d4 /syncapi/storage/postgres/send_to_device_table.go | |
parent | 60524f4b994ba070fff74fa47599e0fcc7856fc0 (diff) |
Update all usages of tx.Stmt to sqlutil.TxStmt (#1423)
* Replace all usages of txn.Stmt with sqlutil.TxStmt
Signed-off-by: Sam Day <me@samcday.com>
* Fix sign off link in PR template.
Signed-off-by: Sam Day <me@samcday.com>
Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to 'syncapi/storage/postgres/send_to_device_table.go')
-rw-r--r-- | syncapi/storage/postgres/send_to_device_table.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/syncapi/storage/postgres/send_to_device_table.go b/syncapi/storage/postgres/send_to_device_table.go index 07af9ad6..be9c347b 100644 --- a/syncapi/storage/postgres/send_to_device_table.go +++ b/syncapi/storage/postgres/send_to_device_table.go @@ -160,13 +160,13 @@ func (s *sendToDeviceStatements) SelectSendToDeviceMessages( func (s *sendToDeviceStatements) UpdateSentSendToDeviceMessages( ctx context.Context, txn *sql.Tx, token string, nids []types.SendToDeviceNID, ) (err error) { - _, err = txn.Stmt(s.updateSentSendToDeviceMessagesStmt).ExecContext(ctx, token, pq.Array(nids)) + _, err = sqlutil.TxStmt(txn, s.updateSentSendToDeviceMessagesStmt).ExecContext(ctx, token, pq.Array(nids)) return } func (s *sendToDeviceStatements) DeleteSendToDeviceMessages( ctx context.Context, txn *sql.Tx, nids []types.SendToDeviceNID, ) (err error) { - _, err = txn.Stmt(s.deleteSendToDeviceMessagesStmt).ExecContext(ctx, pq.Array(nids)) + _, err = sqlutil.TxStmt(txn, s.deleteSendToDeviceMessagesStmt).ExecContext(ctx, pq.Array(nids)) return } |