aboutsummaryrefslogtreecommitdiff
path: root/roomserver/storage/sqlite3/rooms_table.go
diff options
context:
space:
mode:
Diffstat (limited to 'roomserver/storage/sqlite3/rooms_table.go')
-rw-r--r--roomserver/storage/sqlite3/rooms_table.go23
1 files changed, 0 insertions, 23 deletions
diff --git a/roomserver/storage/sqlite3/rooms_table.go b/roomserver/storage/sqlite3/rooms_table.go
index 22700a71..5034b242 100644
--- a/roomserver/storage/sqlite3/rooms_table.go
+++ b/roomserver/storage/sqlite3/rooms_table.go
@@ -65,9 +65,6 @@ const selectRoomVersionsForRoomNIDsSQL = "" +
const selectRoomInfoSQL = "" +
"SELECT room_version, room_nid, state_snapshot_nid, latest_event_nids FROM roomserver_rooms WHERE room_id = $1"
-const selectRoomIDsSQL = "" +
- "SELECT room_id FROM roomserver_rooms WHERE latest_event_nids != '[]'"
-
const bulkSelectRoomIDsSQL = "" +
"SELECT room_id FROM roomserver_rooms WHERE room_nid IN ($1)"
@@ -87,7 +84,6 @@ type roomStatements struct {
updateLatestEventNIDsStmt *sql.Stmt
//selectRoomVersionForRoomNIDStmt *sql.Stmt
selectRoomInfoStmt *sql.Stmt
- selectRoomIDsStmt *sql.Stmt
}
func CreateRoomsTable(db *sql.DB) error {
@@ -108,29 +104,10 @@ func PrepareRoomsTable(db *sql.DB) (tables.Rooms, error) {
{&s.updateLatestEventNIDsStmt, updateLatestEventNIDsSQL},
//{&s.selectRoomVersionForRoomNIDsStmt, selectRoomVersionForRoomNIDsSQL},
{&s.selectRoomInfoStmt, selectRoomInfoSQL},
- {&s.selectRoomIDsStmt, selectRoomIDsSQL},
{&s.selectRoomNIDForUpdateStmt, selectRoomNIDForUpdateSQL},
}.Prepare(db)
}
-func (s *roomStatements) SelectRoomIDsWithEvents(ctx context.Context, txn *sql.Tx) ([]string, error) {
- stmt := sqlutil.TxStmt(txn, s.selectRoomIDsStmt)
- rows, err := stmt.QueryContext(ctx)
- if err != nil {
- return nil, err
- }
- defer internal.CloseAndLogIfError(ctx, rows, "selectRoomIDsStmt: rows.close() failed")
- var roomIDs []string
- var roomID string
- for rows.Next() {
- if err = rows.Scan(&roomID); err != nil {
- return nil, err
- }
- roomIDs = append(roomIDs, roomID)
- }
- return roomIDs, rows.Err()
-}
-
func (s *roomStatements) SelectRoomInfo(ctx context.Context, txn *sql.Tx, roomID string) (*types.RoomInfo, error) {
var info types.RoomInfo
var latestNIDsJSON string