Class SQLiteDatabaseClient

java.lang.Object
dev.rafex.ether.database.sqlite.client.SQLiteDatabaseClient
All Implemented Interfaces:
dev.rafex.ether.database.core.DatabaseClient, dev.rafex.ether.database.core.transaction.TransactionRunner

public class SQLiteDatabaseClient extends Object implements dev.rafex.ether.database.core.DatabaseClient
SQLite-specific wrapper around JdbcDatabaseClient.

This class provides SQLite-specific configuration and error handling while delegating all database operations to JdbcDatabaseClient.

  • Constructor Details

    • SQLiteDatabaseClient

      public SQLiteDatabaseClient(DataSource dataSource)
      Creates a new SQLiteDatabaseClient with the specified data source.
      Parameters:
      dataSource - the data source to use for database connections
      Throws:
      NullPointerException - if dataSource is null
    • SQLiteDatabaseClient

      public SQLiteDatabaseClient(DataSource dataSource, SQLiteConfig config)
      Creates a new SQLiteDatabaseClient with the specified data source and configuration.
      Parameters:
      dataSource - the data source to use for database connections
      config - the SQLite configuration to apply
      Throws:
      NullPointerException - if dataSource or config is null
  • Method Details

    • builder

      public static SQLiteDatabaseClient.Builder builder(DataSource dataSource)
      Returns a builder for creating SQLiteDatabaseClient instances.
      Parameters:
      dataSource - the data source to use
      Returns:
      a builder instance
    • getConfig

      public Optional<SQLiteConfig> getConfig()
      Returns the SQLite configuration, if present.
      Returns:
      an optional containing the SQLite configuration, or empty if not configured
    • query

      public <T> T query(dev.rafex.ether.database.core.sql.SqlQuery query, dev.rafex.ether.database.core.mapping.ResultSetExtractor<T> extractor)
      Specified by:
      query in interface dev.rafex.ether.database.core.DatabaseClient
    • queryList

      public <T> List<T> queryList(dev.rafex.ether.database.core.sql.SqlQuery query, dev.rafex.ether.database.core.mapping.RowMapper<T> mapper)
      Specified by:
      queryList in interface dev.rafex.ether.database.core.DatabaseClient
    • queryOne

      public <T> Optional<T> queryOne(dev.rafex.ether.database.core.sql.SqlQuery query, dev.rafex.ether.database.core.mapping.RowMapper<T> mapper)
      Specified by:
      queryOne in interface dev.rafex.ether.database.core.DatabaseClient
    • execute

      public int execute(dev.rafex.ether.database.core.sql.SqlQuery query)
      Specified by:
      execute in interface dev.rafex.ether.database.core.DatabaseClient
    • batch

      public long[] batch(String sql, List<dev.rafex.ether.database.core.sql.StatementBinder> binders)
      Specified by:
      batch in interface dev.rafex.ether.database.core.DatabaseClient
    • inTransaction

      public <T> T inTransaction(dev.rafex.ether.database.core.transaction.TransactionCallback<T> callback)
      Specified by:
      inTransaction in interface dev.rafex.ether.database.core.transaction.TransactionRunner