SQLiteConnection
public interface SQLiteConnection extends AutoCloseable
SupportSQLiteConnection |
A |
SQLite connection definition.
A connection to a database is a resource that must be released once it is no longer needed via its close function.
See also Database Connection
Summary
Public methods |
|
|---|---|
abstract void |
close()Closes the database connection. |
default boolean |
Returns true if the connection has an active transaction, false otherwise. |
abstract @NonNull SQLiteStatement |
Prepares a new SQL statement. |
Extension functions |
|
|---|---|
default final void |
Executes a single SQL statement that returns no values. |
default final void |
SQLiteAsync.executeSQL(Executes a single SQL statement that returns no values. |
default final @NonNull SQLiteStatement |
SQLiteAsync.prepare(Prepares a new SQL statement. |
Public methods
close
abstract void close()
Closes the database connection.
Once a connection is closed it should no longer be used. Calling this function on an already closed database connection is a no-op.
inTransaction
default boolean inTransaction()
Returns true if the connection has an active transaction, false otherwise.
prepare
abstract @NonNull SQLiteStatement prepare(@NonNull String sql)
Prepares a new SQL statement.
See also Compiling a SQL statement
| Returns | |
|---|---|
@NonNull SQLiteStatement |
the prepared statement. |
Extension functions
SQLite.execSQL
default final void SQLite.execSQL(@NonNull SQLiteConnection receiver, @NonNull String sql)
Executes a single SQL statement that returns no values.
SQLiteAsync.executeSQL
default final void SQLiteAsync.executeSQL(
@NonNull SQLiteConnection receiver,
@NonNull String sql
)
Executes a single SQL statement that returns no values.
On web targets this function is asynchronous while for non-web it is synchronous.
SQLiteAsync.prepare
default final @NonNull SQLiteStatement SQLiteAsync.prepare(
@NonNull SQLiteConnection receiver,
@NonNull String sql
)
Prepares a new SQL statement.
On web targets this function is asynchronous while for non-web it is synchronous.