- pub async fn read_id_from_code(pool: &DbPool, code_: &str) -> Result<LanguageId, Error> {
- let conn = &mut get_conn(pool).await?;
- Ok(
- language
- .filter(code.eq(code_))
- .first::<Self>(conn)
- .await?
- .id,
- )
- }
-
- pub async fn read_id_from_code_opt(
- pool: &DbPool,
+ /// Attempts to find the given language code and return its ID. If not found, returns none.
+ pub async fn read_id_from_code(
+ pool: &mut DbPool<'_>,