generated from recmo/rust-service-template
-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved identity_is_queued_for_deletion
- Loading branch information
1 parent
cfce7e5
commit e529558
Showing
1 changed file
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -303,15 +303,6 @@ impl Database { | |
.into_iter() | ||
.collect()) | ||
} | ||
|
||
// TODO: add docs | ||
pub async fn identity_is_queued_for_deletion(&self, commitment: &Hash) -> Result<bool, Error> { | ||
let query_queued_deletion = | ||
sqlx::query(r#"SELECT exists(SELECT 1 FROM deletions where commitment = $1)"#) | ||
.bind(commitment); | ||
let row_unprocessed = self.pool.fetch_one(query_queued_deletion).await?; | ||
Ok(row_unprocessed.get::<bool, _>(0)) | ||
} | ||
} | ||
|
||
/// This trait provides the individual and composable queries to the database. | ||
|
@@ -832,6 +823,15 @@ pub trait DatabaseExt<'a>: Executor<'a, Database = Postgres> { | |
.await? | ||
.get::<bool, _>(0)) | ||
} | ||
|
||
// TODO: add docs | ||
async fn identity_is_queued_for_deletion(self, commitment: &Hash) -> Result<bool, Error> { | ||
Check failure on line 828 in src/database/mod.rs GitHub Actions / clippyfunctions in traits cannot be declared `async`
|
||
let query_queued_deletion = | ||
sqlx::query(r#"SELECT exists(SELECT 1 FROM deletions where commitment = $1)"#) | ||
.bind(commitment); | ||
let row_unprocessed = self.fetch_one(query_queued_deletion).await?; | ||
Ok(row_unprocessed.get::<bool, _>(0)) | ||
} | ||
} | ||
|
||
#[derive(Debug, Error)] | ||
|