SentrySqfliteDatabaseFactory class
Using this factory, all Database instances will be wrapped with Sentry.
Only use the factory if you want to wrap all Database instances even from
3rd party libraries and SDKs, otherwise prefer the openDatabaseWithSentry
or SentryDatabase constructor.
import 'package:sqflite/sqflite.dart';
databaseFactory = SentrySqfliteDatabaseFactory();
// or SentrySqfliteDatabaseFactory(databaseFactory: databaseFactoryFfi);
// if you are using the FFI or Web implementation.
final database = await openDatabase('path/to/db');
Constructors
- SentrySqfliteDatabaseFactory({DatabaseFactory? databaseFactory, @internal Hub? hub})
-
import 'package:sqflite/sqflite.dart'; databaseFactory = SentrySqfliteDatabaseFactory(); final database = await openDatabase('path/to/db');
Properties
-
databaseOpenHelpers
↔ Map<
String, SqfliteDatabaseOpenHelper> -
Open helpers for single instances only.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tag ↔ String?
-
Optional tag (read-only)
getter/setter pairinherited
Methods
-
closeDatabase(
SqfliteDatabase database) → Future< void> -
Close the database.
inherited
-
databaseExists(
String path) → Future< bool> -
Check if a database exists.
inherited
-
deleteDatabase(
String path) → Future< void> -
Delete the database file.
inherited
-
fixPath(
String path) → Future< String> -
path must be non null
inherited
-
getDatabasesPath(
) → Future< String> -
Get the default databases location path.
inherited
-
getDebugInfo(
) → Future< SqfliteDebugInfo> -
Debug information.
inherited
-
invokeDeleteDatabase(
String path) → Future< void> -
Invoke delete database.
inherited
-
invokeMethod<
T> (String method, [Object? arguments]) → Future< T> - Invoke method
-
newDatabase(
SqfliteDatabaseOpenHelper openHelper, String path) → SqfliteDatabase -
Create a new database object.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openDatabase(
String path, {OpenDatabaseOptions? options}) → Future< Database> -
Open a database at
pathwith the givenOpenDatabaseOptionsoptions -
readDatabaseBytes(
String path) → Future< Uint8List> -
Read database bytes.
inherited
-
removeDatabaseOpenHelper(
String path) → void -
Remove our internal open helper.
inherited
-
safeInvokeMethod<
T> (String method, [Object? arguments]) → Future< T> -
Invoke native method and wrap exception.
inherited
-
setDatabasesPath(
String? path) → Future< void> -
Set the databases path.
inherited
-
setDatabasesPathOrNull(
String? path) → void -
Set the databases path.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
wrapDatabaseException<
T> (Future< T> action()) → Future<T> -
To override to wrap wanted exception
inherited
-
writeDatabaseBytes(
String path, Uint8List bytes) → Future< void> -
Write database bytes.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited