Skip to content

Commit

Permalink
Add a note to close database before deleting it (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
devashishdxt authored Jul 4, 2024
1 parent d13651e commit 912b7a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/rexie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ impl Rexie {
self.database.close();
}

/// Deletes a database
/// Deletes a database. Note that the future returned by this function doesn't reach completion until the database
/// is closed across all tabs in the browser.
pub async fn delete(name: &str) -> Result<()> {
Self::builder(name).delete().await
}
Expand Down
3 changes: 2 additions & 1 deletion src/rexie_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ impl RexieBuilder {
Ok(Rexie { database })
}

/// Delete the database.
/// Delete the database. Note that the future returned by this function doesn't reach completion until the database
/// is closed across all tabs in the browser.
pub async fn delete(self) -> Result<()> {
let factory = Factory::new()?;
factory.delete(&self.name)?.await.map_err(Into::into)
Expand Down

0 comments on commit 912b7a0

Please sign in to comment.