aboutsummaryrefslogtreecommitdiff
path: root/userapi/storage/accounts/postgres/accounts_table.go
diff options
context:
space:
mode:
authorSam <me@samcday.com>2020-09-24 12:10:14 +0200
committerGitHub <noreply@github.com>2020-09-24 11:10:14 +0100
commita6700331cee70a3ca04c834efdc68cc2ef63947d (patch)
tree10420639a2a4685b2562ff1d106d1ae9a11712d4 /userapi/storage/accounts/postgres/accounts_table.go
parent60524f4b994ba070fff74fa47599e0fcc7856fc0 (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 'userapi/storage/accounts/postgres/accounts_table.go')
-rw-r--r--userapi/storage/accounts/postgres/accounts_table.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/userapi/storage/accounts/postgres/accounts_table.go b/userapi/storage/accounts/postgres/accounts_table.go
index 8c8d32cf..7500e1e8 100644
--- a/userapi/storage/accounts/postgres/accounts_table.go
+++ b/userapi/storage/accounts/postgres/accounts_table.go
@@ -20,6 +20,7 @@ import (
"time"
"github.com/matrix-org/dendrite/clientapi/userutil"
+ "github.com/matrix-org/dendrite/internal/sqlutil"
"github.com/matrix-org/dendrite/userapi/api"
"github.com/matrix-org/gomatrixserverlib"
@@ -99,7 +100,7 @@ func (s *accountsStatements) insertAccount(
ctx context.Context, txn *sql.Tx, localpart, hash, appserviceID string,
) (*api.Account, error) {
createdTimeMS := time.Now().UnixNano() / 1000000
- stmt := txn.Stmt(s.insertAccountStmt)
+ stmt := sqlutil.TxStmt(txn, s.insertAccountStmt)
var err error
if appserviceID == "" {
@@ -162,7 +163,7 @@ func (s *accountsStatements) selectNewNumericLocalpart(
) (id int64, err error) {
stmt := s.selectNewNumericLocalpartStmt
if txn != nil {
- stmt = txn.Stmt(stmt)
+ stmt = sqlutil.TxStmt(txn, stmt)
}
err = stmt.QueryRowContext(ctx).Scan(&id)
return