SupportSQLiteConnection


public final class SupportSQLiteConnection implements SQLiteConnection


A SQLiteConnection implemented by androidx.sqlite.db.SupportSQLiteDatabase and that uses the Android's SQLite through the SupportSQLite APIs.

Summary

Public methods

void

Closes the database connection.

final @NonNull SupportSQLiteDatabase
boolean

Returns true if the connection has an active transaction, false otherwise.

@NonNull SQLiteStatement

Prepares a new SQL statement.

Public constructors

SupportSQLiteConnection

Added in 2.6.0-alpha01
public SupportSQLiteConnection(@NonNull SupportSQLiteDatabase db)

Public methods

close

Added in 2.6.0-alpha01
public 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.

getDb

Added in 2.6.0-alpha01
public final @NonNull SupportSQLiteDatabase getDb()

inTransaction

public boolean inTransaction()

Returns true if the connection has an active transaction, false otherwise.

prepare

Added in 2.6.0-alpha01
public @NonNull SQLiteStatement prepare(@NonNull String sql)

Prepares a new SQL statement.

See also Compiling a SQL statement

Parameters
@NonNull String sql

the SQL statement to prepare

Returns
@NonNull SQLiteStatement

the prepared statement.