aboutsummaryrefslogtreecommitdiff
path: root/roomserver/storage/postgres/rooms_table.go
diff options
context:
space:
mode:
authorKegsay <kegan@matrix.org>2020-05-21 14:40:13 +0100
committerGitHub <noreply@github.com>2020-05-21 14:40:13 +0100
commit24d8df664c21fa8bd68d80b5585a496e264c410a (patch)
tree0a176d6dfd7f81522c5739b53313366b552b0ce1 /roomserver/storage/postgres/rooms_table.go
parent3fdb045116c9cd2f2a3badfebec0645d0381bacb (diff)
Fix #897 and shuffle directory around (#1054)
* Fix #897 and shuffle directory around * Update find-lint * goimports Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com>
Diffstat (limited to 'roomserver/storage/postgres/rooms_table.go')
-rw-r--r--roomserver/storage/postgres/rooms_table.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/roomserver/storage/postgres/rooms_table.go b/roomserver/storage/postgres/rooms_table.go
index ef5b510c..fc64489d 100644
--- a/roomserver/storage/postgres/rooms_table.go
+++ b/roomserver/storage/postgres/rooms_table.go
@@ -21,7 +21,7 @@ import (
"errors"
"github.com/lib/pq"
- "github.com/matrix-org/dendrite/common"
+ "github.com/matrix-org/dendrite/internal"
"github.com/matrix-org/dendrite/roomserver/types"
"github.com/matrix-org/gomatrixserverlib"
)
@@ -103,7 +103,7 @@ func (s *roomStatements) insertRoomNID(
roomID string, roomVersion gomatrixserverlib.RoomVersion,
) (types.RoomNID, error) {
var roomNID int64
- stmt := common.TxStmt(txn, s.insertRoomNIDStmt)
+ stmt := internal.TxStmt(txn, s.insertRoomNIDStmt)
err := stmt.QueryRowContext(ctx, roomID, roomVersion).Scan(&roomNID)
return types.RoomNID(roomNID), err
}
@@ -112,7 +112,7 @@ func (s *roomStatements) selectRoomNID(
ctx context.Context, txn *sql.Tx, roomID string,
) (types.RoomNID, error) {
var roomNID int64
- stmt := common.TxStmt(txn, s.selectRoomNIDStmt)
+ stmt := internal.TxStmt(txn, s.selectRoomNIDStmt)
err := stmt.QueryRowContext(ctx, roomID).Scan(&roomNID)
return types.RoomNID(roomNID), err
}
@@ -140,7 +140,7 @@ func (s *roomStatements) selectLatestEventsNIDsForUpdate(
var nids pq.Int64Array
var lastEventSentNID int64
var stateSnapshotNID int64
- stmt := common.TxStmt(txn, s.selectLatestEventNIDsForUpdateStmt)
+ stmt := internal.TxStmt(txn, s.selectLatestEventNIDsForUpdateStmt)
err := stmt.QueryRowContext(ctx, int64(roomNID)).Scan(&nids, &lastEventSentNID, &stateSnapshotNID)
if err != nil {
return nil, 0, 0, err
@@ -160,7 +160,7 @@ func (s *roomStatements) updateLatestEventNIDs(
lastEventSentNID types.EventNID,
stateSnapshotNID types.StateSnapshotNID,
) error {
- stmt := common.TxStmt(txn, s.updateLatestEventNIDsStmt)
+ stmt := internal.TxStmt(txn, s.updateLatestEventNIDsStmt)
_, err := stmt.ExecContext(
ctx,
roomNID,
@@ -175,7 +175,7 @@ func (s *roomStatements) selectRoomVersionForRoomID(
ctx context.Context, txn *sql.Tx, roomID string,
) (gomatrixserverlib.RoomVersion, error) {
var roomVersion gomatrixserverlib.RoomVersion
- stmt := common.TxStmt(txn, s.selectRoomVersionForRoomIDStmt)
+ stmt := internal.TxStmt(txn, s.selectRoomVersionForRoomIDStmt)
err := stmt.QueryRowContext(ctx, roomID).Scan(&roomVersion)
if err == sql.ErrNoRows {
return roomVersion, errors.New("room not found")
@@ -187,7 +187,7 @@ func (s *roomStatements) selectRoomVersionForRoomNID(
ctx context.Context, txn *sql.Tx, roomNID types.RoomNID,
) (gomatrixserverlib.RoomVersion, error) {
var roomVersion gomatrixserverlib.RoomVersion
- stmt := common.TxStmt(txn, s.selectRoomVersionForRoomNIDStmt)
+ stmt := internal.TxStmt(txn, s.selectRoomVersionForRoomNIDStmt)
err := stmt.QueryRowContext(ctx, roomNID).Scan(&roomVersion)
if err == sql.ErrNoRows {
return roomVersion, errors.New("room not found")