Delete account
This commit is contained in:
parent
7d1c1912f7
commit
d056567dc6
|
@ -730,6 +730,13 @@ impl DbAdapter {
|
||||||
self.connection.execute("DELETE FROM transactions", NO_PARAMS)?;
|
self.connection.execute("DELETE FROM transactions", NO_PARAMS)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn delete_account(&self, account: u32) -> anyhow::Result<()> {
|
||||||
|
self.connection.execute("DELETE FROM received_notes WHERE account = ?1", params![account])?;
|
||||||
|
self.connection.execute("DELETE FROM accounts WHERE id_account = ?1", params![account])?;
|
||||||
|
self.connection.execute("DELETE FROM taddrs WHERE account = ?1", params![account])?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
|
@ -502,6 +502,11 @@ impl Wallet {
|
||||||
Ok(quotes.len() as u32)
|
Ok(quotes.len() as u32)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn delete_account(&self, account: u32) -> anyhow::Result<()> {
|
||||||
|
self.db.delete_account(account)?;
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
pub fn truncate_data(&self) -> anyhow::Result<()> {
|
pub fn truncate_data(&self) -> anyhow::Result<()> {
|
||||||
self.db.truncate_data()
|
self.db.truncate_data()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue