sentry_sqflite 8.10.1 copy "sentry_sqflite: ^8.10.1" to clipboard
sentry_sqflite: ^8.10.1 copied to clipboard

An integration which adds support for performance tracing for the sqflite package.


Sentry integration for sqflite package #

package build pub likes popularity pub points
sentry_sqflite build pub package likes popularity pub points

Integration for the sqflite package.

Usage

  • Sign up for a Sentry.io account and get a DSN at https://sentry.io.

  • Follow the installing instructions on pub.dev.

  • Initialize the Sentry SDK using the DSN issued by Sentry.io.

  • Call...

import 'package:sentry_flutter/sentry_flutter.dart';
import 'package:sqflite/sqflite.dart';
import 'package:sentry_sqflite/sentry_sqflite.dart';

Future<void> main() async {
  await SentryFlutter.init(
    (options) {
      options.dsn = 'https://example@sentry.io/add-your-dsn-here';
      options.tracesSampleRate = 1.0;
    },
    // Init your App.
    appRunner: () => runApp(MyApp()),
  );
}

Future<void> insertProducts() async {
  databaseFactory = SentrySqfliteDatabaseFactory();

  final db = await openDatabase(inMemoryDatabasePath);
  await db.execute('''
      CREATE TABLE Product (
        id INTEGER PRIMARY KEY,
        title TEXT
      )
  ''');
  await db.insert('Product', <String, Object?>{'title': 'Product 1'});
  await db.insert('Product', <String, Object?>{'title': 'Product 2'});

  final result = await db.query('Product');
  print(result);

  await db.close();
}

Resources

  • Flutter docs
  • Dart docs
  • Discussions
  • Discord Chat
  • Stack Overflow
  • Twitter Follow
3
likes
160
pub points
81%
popularity

Publisher

verified publishersentry.io

An integration which adds support for performance tracing for the sqflite package.

Homepage
Repository (GitHub)
View/report issues
Contributing

Documentation

API reference

License

MIT (license)

Dependencies

meta, path, sentry, sqflite, sqflite_common

More

Packages that depend on sentry_sqflite