PooledConnection
public interface PooledConnection
TransactionScope |
A |
Transactor |
A |
A wrapper of SQLiteConnection that belongs to a connection pool and is safe to use in a coroutine.
Summary
Public methods |
|
|---|---|
abstract @NonNull R |
<R extends Object> usePrepared(Prepares a new SQL statement and use it within the code |
Extension functions |
|
|---|---|
default final void |
TransactorKt.execSQL(Executes a single SQL statement that returns no values. |
Public methods
usePrepared
abstract @NonNull R <R extends Object> usePrepared(
@NonNull String sql,
@NonNull Function1<@NonNull SQLiteStatement, @NonNull R> block
)
Prepares a new SQL statement and use it within the code block.
Using the given SQLiteStatement after block completes is prohibited. The statement will also be thread confined, attempting to use it from another thread is an error.
Using a statement locks the connection it belongs to, therefore try not to do long-running computations within the block.
Extension functions
TransactorKt.execSQL
default final void TransactorKt.execSQL(
@NonNull PooledConnection receiver,
@NonNull String sql
)
Executes a single SQL statement that returns no values.