mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 18:18:03 +00:00
Add final
This commit is contained in:
parent
8ac09b73bf
commit
9e9c65d17d
17 changed files with 18 additions and 19 deletions
|
@ -9,7 +9,7 @@ import tech.turso.jdbc4.JDBC4Connection;
|
|||
import tech.turso.utils.Logger;
|
||||
import tech.turso.utils.LoggerFactory;
|
||||
|
||||
public class JDBC implements Driver {
|
||||
public final class JDBC implements Driver {
|
||||
private static final Logger logger = LoggerFactory.getLogger(JDBC.class);
|
||||
|
||||
private static final String VALID_URL_PREFIX = "jdbc:sqlite:";
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.util.Arrays;
|
|||
import java.util.Properties;
|
||||
|
||||
/** Limbo Configuration. */
|
||||
public class LimboConfig {
|
||||
public final class LimboConfig {
|
||||
private final Properties pragma;
|
||||
|
||||
public LimboConfig(Properties properties) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import tech.turso.annotations.Nullable;
|
|||
import tech.turso.annotations.SkipNullableCheck;
|
||||
|
||||
/** Provides {@link DataSource} API for configuring Limbo database connection. */
|
||||
public class LimboDataSource implements DataSource {
|
||||
public final class LimboDataSource implements DataSource {
|
||||
|
||||
private final LimboConfig limboConfig;
|
||||
private final String url;
|
||||
|
|
|
@ -10,7 +10,7 @@ import tech.turso.utils.LimboExceptionUtils;
|
|||
import tech.turso.utils.Logger;
|
||||
import tech.turso.utils.LoggerFactory;
|
||||
|
||||
public class LimboConnection {
|
||||
public final class LimboConnection {
|
||||
private static final Logger logger = LoggerFactory.getLogger(LimboConnection.class);
|
||||
|
||||
private final String url;
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
* Factory class for managing and creating instances of {@link LimboDB}. This class ensures that
|
||||
* multiple instances of {@link LimboDB} with the same URL are not created.
|
||||
*/
|
||||
public class LimboDBFactory {
|
||||
public final class LimboDBFactory {
|
||||
|
||||
private static final ConcurrentHashMap<String, LimboDB> databaseHolder =
|
||||
new ConcurrentHashMap<>();
|
||||
|
|
|
@ -13,7 +13,7 @@ import tech.turso.utils.LoggerFactory;
|
|||
* <p>A {@link LimboResultSet} object is automatically closed when the {@link LimboStatement} object
|
||||
* that generated it is closed or re-executed.
|
||||
*/
|
||||
public class LimboResultSet {
|
||||
public final class LimboResultSet {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(LimboResultSet.class);
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import tech.turso.utils.LoggerFactory;
|
|||
* objects. All execution method in the <code>LimboStatement</code> implicitly close the current
|
||||
* <code>resultSet</code> object of the statement if an open one exists.
|
||||
*/
|
||||
public class LimboStatement {
|
||||
public final class LimboStatement {
|
||||
private static final Logger log = LoggerFactory.getLogger(LimboStatement.class);
|
||||
|
||||
private final String sql;
|
||||
|
|
|
@ -5,7 +5,7 @@ import tech.turso.annotations.NativeInvocation;
|
|||
import tech.turso.annotations.Nullable;
|
||||
|
||||
/** Represents the step result of limbo's statement's step function. */
|
||||
public class LimboStepResult {
|
||||
public final class LimboStepResult {
|
||||
private static final int STEP_RESULT_ID_ROW = 10;
|
||||
private static final int STEP_RESULT_ID_IO = 20;
|
||||
private static final int STEP_RESULT_ID_DONE = 30;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
package tech.turso.core;
|
||||
|
||||
/** Sqlite error codes. */
|
||||
public class SqliteCode {
|
||||
public final class SqliteCode {
|
||||
/** Successful result */
|
||||
public static final int SQLITE_OK = 0;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package tech.turso.exceptions;
|
|||
import java.sql.SQLException;
|
||||
import tech.turso.LimboErrorCode;
|
||||
|
||||
public class LimboException extends SQLException {
|
||||
public final class LimboException extends SQLException {
|
||||
private final LimboErrorCode resultCode;
|
||||
|
||||
public LimboException(String message, LimboErrorCode resultCode) {
|
||||
|
|
|
@ -9,7 +9,7 @@ import tech.turso.annotations.SkipNullableCheck;
|
|||
import tech.turso.core.LimboConnection;
|
||||
import tech.turso.core.LimboStatement;
|
||||
|
||||
public class JDBC4Connection implements Connection {
|
||||
public final class JDBC4Connection implements Connection {
|
||||
|
||||
private final LimboConnection connection;
|
||||
|
||||
|
@ -87,8 +87,7 @@ public class JDBC4Connection implements Connection {
|
|||
@Override
|
||||
@SkipNullableCheck
|
||||
public DatabaseMetaData getMetaData() throws SQLException {
|
||||
// TODO
|
||||
return null;
|
||||
return new JDBC4DatabaseMetaData(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -15,7 +15,7 @@ import tech.turso.annotations.SkipNullableCheck;
|
|||
import tech.turso.utils.Logger;
|
||||
import tech.turso.utils.LoggerFactory;
|
||||
|
||||
public class JDBC4DatabaseMetaData implements DatabaseMetaData {
|
||||
public final class JDBC4DatabaseMetaData implements DatabaseMetaData {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(JDBC4DatabaseMetaData.class);
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import java.util.Calendar;
|
|||
import tech.turso.annotations.SkipNullableCheck;
|
||||
import tech.turso.core.LimboResultSet;
|
||||
|
||||
public class JDBC4PreparedStatement extends JDBC4Statement implements PreparedStatement {
|
||||
public final class JDBC4PreparedStatement extends JDBC4Statement implements PreparedStatement {
|
||||
|
||||
private final String sql;
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import tech.turso.annotations.Nullable;
|
|||
import tech.turso.annotations.SkipNullableCheck;
|
||||
import tech.turso.core.LimboResultSet;
|
||||
|
||||
public class JDBC4ResultSet implements ResultSet {
|
||||
public final class JDBC4ResultSet implements ResultSet {
|
||||
|
||||
private final LimboResultSet resultSet;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package tech.turso.utils;
|
|||
import java.nio.charset.StandardCharsets;
|
||||
import tech.turso.annotations.Nullable;
|
||||
|
||||
public class ByteArrayUtils {
|
||||
public final class ByteArrayUtils {
|
||||
@Nullable
|
||||
public static String utf8ByteBufferToString(@Nullable byte[] buffer) {
|
||||
if (buffer == null) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import tech.turso.LimboErrorCode;
|
|||
import tech.turso.annotations.Nullable;
|
||||
import tech.turso.exceptions.LimboException;
|
||||
|
||||
public class LimboExceptionUtils {
|
||||
public final class LimboExceptionUtils {
|
||||
/**
|
||||
* Throws formatted SQLException with error code and message.
|
||||
*
|
||||
|
|
|
@ -6,7 +6,7 @@ import java.util.logging.Level;
|
|||
* A factory for {@link Logger} instances that uses SLF4J if present, falling back on a
|
||||
* java.util.logging implementation otherwise.
|
||||
*/
|
||||
public class LoggerFactory {
|
||||
public final class LoggerFactory {
|
||||
static final boolean USE_SLF4J;
|
||||
|
||||
static {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue