sentry_sqflite 7.2.0 copy "sentry_sqflite: ^7.2.0" to clipboard
sentry_sqflite: ^7.2.0 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

  • Documentation
  • Forum
  • Discord
  • Stack Overflow
  • Twitter Follow
3
likes
0
pub points
80%
popularity

Publisher

verified publishersentry.io

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

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta, sentry, sqflite, sqflite_common

More

Packages that depend on sentry_sqflite