+ try (final var connection = database.getConnection()) {
+ return getEntry(connection, key);
+ } catch (SQLException e) {
+ throw new RuntimeException("Failed read from pre_key store", e);
+ }
+ }
+
+ public <T> void storeEntry(KeyValueEntry<T> key, T value) {
+ try (final var connection = database.getConnection()) {
+ storeEntry(connection, key, value);
+ } catch (SQLException e) {
+ throw new RuntimeException("Failed update key_value store", e);
+ }
+ }
+
+ private <T> T getEntry(final Connection connection, final KeyValueEntry<T> key) throws SQLException {