From a6700331cee70a3ca04c834efdc68cc2ef63947d Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 24 Sep 2020 12:10:14 +0200 Subject: Update all usages of tx.Stmt to sqlutil.TxStmt (#1423) * Replace all usages of txn.Stmt with sqlutil.TxStmt Signed-off-by: Sam Day * Fix sign off link in PR template. Signed-off-by: Sam Day Co-authored-by: Neil Alexander --- userapi/storage/accounts/postgres/accounts_table.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'userapi/storage/accounts/postgres/accounts_table.go') 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 -- cgit v1.2.3