java.lang.Object
com.inductiveautomation.ignition.gateway.util.sqlite.SqliteInstance

public class SqliteInstance extends Object
  • Constructor Details

    • SqliteInstance

      public SqliteInstance(Path path)
  • Method Details

    • createConfiguration

      protected org.sqlite.SQLiteConfig createConfiguration()
    • getConnection

      public Connection getConnection() throws SQLException
      Throws:
      SQLException
    • query

      @NotNull public <T> @NotNull List<T> query(SqliteInstance.PreparedQueryProvider query, SqliteInstance.RowMapper<T> rowMapper) throws SQLException
      Executes a query that returns a result set, using rowMapper to translate each row of the result set into some domain type. Automatically closes the provided connection and result set.
      Parameters:
      query - A function that accepts a connection and return a fully configured PreparedStatement, e.g. with parameters, if any, specified.
      rowMapper - A function that accepts a ResultSet and returns an instance of type T.
      Returns:
      An unmodifiable list of type T.
      Throws:
      SQLException - If an error occurs while executing the query, retrieving the connection, etc.
    • queryOne

      @Nullable public <T> T queryOne(SqliteInstance.PreparedQueryProvider query, SqliteInstance.RowMapper<T> rowMapper) throws SQLException
      Executes a query that returns a single result, using rowMapper to translate the result set into some domain type. Automatically closes the provided connection and result set.
      Parameters:
      query - A function that accepts a connection and return a fully configured PreparedStatement, e.g. with parameters, if any, specified.
      rowMapper - A function that accepts a ResultSet and returns an instance of type T.
      Returns:
      An instance of type T, or null if the result set is empty.
      Throws:
      SQLException - If an error occurs while executing the query, retrieving the connection, etc.
    • getPath

      @NotNull public @NotNull Path getPath()