We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b6bd1d commit 4ed1f7bCopy full SHA for 4ed1f7b
src/models/beatmap/query/by_id.rs
@@ -2,18 +2,20 @@ use crate::define_by_id;
2
use crate::models::beatmap::types::BeatmapRow;
3
use sqlx::{Error as SqlxError, PgPool};
4
5
-define_by_id!(find_by_id, "beatmap", BeatmapRow,
+define_by_id!(
6
+ find_by_id,
7
+ "beatmap",
8
+ BeatmapRow,
9
"id, osu_id, beatmapset_id, difficulty, difficulty_rating, count_circles,
10
count_sliders, count_spinners, max_combo, drain_time, total_time, bpm, cs,
- ar, od, hp, mode, status, file_md5, file_path, created_at");
11
+ ar, od, hp, mode, status, file_md5, file_path, created_at"
12
+);
13
14
pub async fn find_by_beatmapset_id(pool: &PgPool, id: i32) -> Result<Option<i32>, SqlxError> {
- Ok(sqlx::query!(
- "SELECT beatmapset_id FROM beatmap WHERE id = $1",
- id
15
+ Ok(
16
+ sqlx::query!("SELECT beatmapset_id FROM beatmap WHERE id = $1", id)
17
+ .fetch_optional(pool)
18
+ .await?
19
+ .and_then(|r| r.beatmapset_id),
20
)
- .fetch_optional(pool)
- .await?
- .and_then(|r| r.beatmapset_id)
- )
-}
21
+}
src/models/score_metadata/query/insert.rs
@@ -1,7 +1,6 @@
1
use crate::define_insert_returning_id;
use crate::models::score_metadata::types::ScoreMetadataRow;
-
define_insert_returning_id!(
insert,
"score_metadata",
0 commit comments