Class SentrySQLiteDriver
-
- All Implemented Interfaces:
-
androidx.sqlite.SQLiteDriver
public final class SentrySQLiteDriver implements SQLiteDriver
Wraps a SQLiteDriver and automatically adds spans for each SQL statement it executes.
Example usage:
val driver = SentrySQLiteDriver.create(AndroidSQLiteDriver())If you use Room:
val database = Room.databaseBuilder(context, MyDatabase::class.java, "dbName") .setDriver(SentrySQLiteDriver.create(AndroidSQLiteDriver())) .build()If you're using the Sentry Android Gradle Plugin (SAGP) 6.13.0+, wrapping will be performed automatically for Room.
-
-
Field Summary
Fields Modifier and Type Field Description private final BooleanhasConnectionPool
-
Method Summary
Modifier and Type Method Description BooleanhasConnectionPool()SQLiteConnectionopen(String fileName)final static SQLiteDrivercreate(SQLiteDriver delegate)Wraps the provided delegate in a SentrySQLiteDriver. -
-
Method Detail
-
hasConnectionPool
Boolean hasConnectionPool()
-
open
SQLiteConnection open(String fileName)
-
create
final static SQLiteDriver create(SQLiteDriver delegate)
Wraps the provided delegate in a SentrySQLiteDriver.
To avoid duplicate spans, returns the delegate as-is if:
it's already wrapped, or
it's an
androidx.sqlite.driver.SupportSQLiteDriver.
In the case of (2), wrap the open helper passed to the
SupportSQLiteDriverconstructor viaSentrySupportSQLiteOpenHelperinstead.Note that wrapping will be performed if the delegate isn't a
SupportSQLiteDriveritself but wraps or subclasses one. In that case, ensure the open helper passed to the support driver constructor is not wrapped.
-
-
-
-