Add support for deleting keys associated with an account.

This commit is contained in:
Jon Chambers
2020-09-22 12:11:48 -04:00
committed by Jon Chambers
parent 86fae58c96
commit 789af0f8a6
2 changed files with 52 additions and 0 deletions

View File

@@ -106,6 +106,16 @@ public class Keys {
}));
}
public void delete(final String number) {
database.use(jdbi -> jdbi.useHandle(handle -> {
try (Timer.Context ignored = getCountTimer.time()) {
handle.createUpdate("DELETE FROM keys WHERE number = :number")
.bind("number", number)
.execute();
}
}));
}
public void vacuum() {
database.use(jdbi -> jdbi.useHandle(handle -> {
try (Timer.Context ignored = vacuumTimer.time()) {