sentry_sqflite

Last updated:

0 purchases

sentry_sqflite Image
sentry_sqflite Images
Add to Cart

Description:

sentry sqflite

Sentry integration for sqflite package #



package
build
pub
likes
popularity
pub points




sentry_sqflite








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://[email protected]/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();
}
copied to clipboard
Resources

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.