MCPcopy Create free account
hub / github.com/Rust-Web-Development/code / get_account

Method get_account

ch_11/src/store.rs:205–222  ·  view source on GitHub ↗
(self, email: String)

Source from the content-addressed store, hash-verified

203 }
204
205 pub async fn get_account(self, email: String) -> Result<Account, Error> {
206 match sqlx::query("SELECT * from accounts where email = $1")
207 .bind(email)
208 .map(|row: PgRow| Account {
209 id: Some(AccountId(row.get("id"))),
210 email: row.get("email"),
211 password: row.get("password"),
212 })
213 .fetch_one(&self.connection)
214 .await
215 {
216 Ok(account) => Ok(account),
217 Err(error) => {
218 tracing::event!(tracing::Level::ERROR, "{:?}", error);
219 Err(Error::DatabaseQueryError(error))
220 }
221 }
222 }
223}

Callers 1

loginFunction · 0.45

Calls 1

AccountIdClass · 0.50

Tested by

no test coverage detected