Skip to content

Commit

Permalink
remove StatementBuilder
Browse files Browse the repository at this point in the history
rework later
  • Loading branch information
HSGamer committed Sep 11, 2024
1 parent 57c8292 commit 78cdab7
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 300 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package me.hsgamer.hscore.database.client.sql;

import me.hsgamer.hscore.database.Client;
import me.hsgamer.hscore.logger.common.LogLevel;
import me.hsgamer.hscore.logger.provider.LoggerProvider;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Optional;

/**
* The interface for SQL client
Expand All @@ -23,29 +20,4 @@ public interface SqlClient<T> extends Client<T> {
* @throws SQLException if there is an SQL error
*/
Connection getConnection() throws SQLException;

/**
* Create a new statement builder for this client
*
* @return the statement builder
*
* @throws SQLException if there is an SQL error
*/
default StatementBuilder createStatementBuilder() throws SQLException {
return StatementBuilder.create(this.getConnection());
}

/**
* Create a new statement builder for this client but ignores exceptions
*
* @return the statement builder
*/
default Optional<StatementBuilder> createStatementBuilderSafe() {
try {
return Optional.of(this.createStatementBuilder());
} catch (Exception e) {
LoggerProvider.getLogger(this.getClass()).log(LogLevel.WARN, e);
return Optional.empty();
}
}
}

This file was deleted.

This file was deleted.

0 comments on commit 78cdab7

Please sign in to comment.