You've already forked AstralRinth
forked from didirus/AstralRinth
Query optimization (#235)
* Optimize version queries and decrease some query complexity * Run formatter
This commit is contained in:
@@ -38,28 +38,6 @@ pub enum DatabaseError {
|
||||
Other(String),
|
||||
}
|
||||
|
||||
impl ids::ChannelId {
|
||||
pub async fn get_id<'a, E>(
|
||||
channel: &str,
|
||||
exec: E,
|
||||
) -> Result<Option<ids::ChannelId>, DatabaseError>
|
||||
where
|
||||
E: sqlx::Executor<'a, Database = sqlx::Postgres>,
|
||||
{
|
||||
let result = sqlx::query!(
|
||||
"
|
||||
SELECT id FROM release_channels
|
||||
WHERE channel = $1
|
||||
",
|
||||
channel
|
||||
)
|
||||
.fetch_optional(exec)
|
||||
.await?;
|
||||
|
||||
Ok(result.map(|r| ids::ChannelId(r.id)))
|
||||
}
|
||||
}
|
||||
|
||||
impl ids::StatusId {
|
||||
pub async fn get_id<'a, E>(
|
||||
status: &crate::models::projects::ProjectStatus,
|
||||
|
||||
Reference in New Issue
Block a user