forked from lavina/lavina
Remove unused
This commit is contained in:
parent
7a75b3fbd1
commit
9ae34c99d3
|
@ -96,27 +96,6 @@ impl Storage {
|
||||||
Ok(res.map(|(id,)| id))
|
Ok(res.map(|(id,)| id))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tracing::instrument(skip(self), name = "Storage::retrieve_user_by_id")]
|
|
||||||
pub async fn retrieve_user_by_id(&self, name: &str) -> Result<Option<u32>> {
|
|
||||||
let mut executor = self.conn.lock().await;
|
|
||||||
let res: Option<(u32,)> = sqlx::query_as(
|
|
||||||
"
|
|
||||||
select
|
|
||||||
u.id,
|
|
||||||
u.name
|
|
||||||
from
|
|
||||||
users u
|
|
||||||
where
|
|
||||||
u.id = ?;
|
|
||||||
",
|
|
||||||
)
|
|
||||||
.bind(name)
|
|
||||||
.fetch_optional(&mut *executor)
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
Ok(res.map(|(id,)| id))
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tracing::instrument(skip(self), name = "Storage::create_or_retrieve_user_id_by_name")]
|
#[tracing::instrument(skip(self), name = "Storage::create_or_retrieve_user_id_by_name")]
|
||||||
pub async fn create_or_retrieve_user_id_by_name(&self, name: &str) -> Result<u32> {
|
pub async fn create_or_retrieve_user_id_by_name(&self, name: &str) -> Result<u32> {
|
||||||
let mut executor = self.conn.lock().await;
|
let mut executor = self.conn.lock().await;
|
||||||
|
|
Loading…
Reference in New Issue