-
- All Implemented Interfaces:
-
androidx.sqlite.db.SupportSQLiteOpenHelper,java.io.Closeable,java.lang.AutoCloseable
public final class SentrySupportSQLiteOpenHelper implements SupportSQLiteOpenHelper
The Sentry's SentrySupportSQLiteOpenHelper, it will automatically add a span out of the active span bound to the scope for each database query. It's a wrapper around an instance of SupportSQLiteOpenHelper.
You can wrap your custom SupportSQLiteOpenHelper instance with
SentrySupportSQLiteOpenHelper(myHelper). If you're using the Sentry Android Gradle plugin, this will be applied automatically.Usage - wrap your custom SupportSQLiteOpenHelper instance in SentrySupportSQLiteOpenHelper
val openHelper = SentrySupportSQLiteOpenHelper.create(myOpenHelper)If you use Room you can wrap the default FrameworkSQLiteOpenHelperFactory:
val database = Room.databaseBuilder(context, MyDatabase::class.java, "dbName") .openHelperFactory { configuration -> SentrySupportSQLiteOpenHelper.create(FrameworkSQLiteOpenHelperFactory().create(configuration)) } ... .build()
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classSentrySupportSQLiteOpenHelper.Companion
-
Field Summary
Fields Modifier and Type Field Description private final SupportSQLiteDatabasewritableDatabaseprivate final SupportSQLiteDatabasereadableDatabaseprivate final StringdatabaseName
-
Method Summary
Modifier and Type Method Description SupportSQLiteDatabasegetWritableDatabase()SupportSQLiteDatabasegetReadableDatabase()StringgetDatabaseName()-
-
Method Detail
-
getWritableDatabase
SupportSQLiteDatabase getWritableDatabase()
-
getReadableDatabase
SupportSQLiteDatabase getReadableDatabase()
-
getDatabaseName
String getDatabaseName()
-
-
-
-