Remove unused db query method
This commit is contained in:
parent
e34ebbc665
commit
0058702749
1 changed files with 0 additions and 26 deletions
|
@ -985,32 +985,6 @@ impl Database {
|
||||||
Ok(room)
|
Ok(room)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn room_id_for_connection(&self, connection_id: ConnectionId) -> Result<RoomId> {
|
|
||||||
#[derive(Copy, Clone, Debug, EnumIter, DeriveColumn)]
|
|
||||||
enum QueryRoomId {
|
|
||||||
RoomId,
|
|
||||||
}
|
|
||||||
|
|
||||||
self.transaction(|tx| async move {
|
|
||||||
Ok(room_participant::Entity::find()
|
|
||||||
.select_only()
|
|
||||||
.column(room_participant::Column::RoomId)
|
|
||||||
.filter(
|
|
||||||
Condition::all()
|
|
||||||
.add(room_participant::Column::AnsweringConnectionId.eq(connection_id.id))
|
|
||||||
.add(
|
|
||||||
room_participant::Column::AnsweringConnectionServerId
|
|
||||||
.eq(ServerId(connection_id.owner_id as i32)),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
.into_values::<_, QueryRoomId>()
|
|
||||||
.one(&*tx)
|
|
||||||
.await?
|
|
||||||
.ok_or_else(|| anyhow!("no room for connection {:?}", connection_id))?)
|
|
||||||
})
|
|
||||||
.await
|
|
||||||
}
|
|
||||||
|
|
||||||
pub async fn room_connection_ids(
|
pub async fn room_connection_ids(
|
||||||
&self,
|
&self,
|
||||||
room_id: RoomId,
|
room_id: RoomId,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue