Package 

Class SentrySupportSQLiteOpenHelper

  • 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()