Skip to content
pubscout

sentry_drift

10.5.0, released 4 days ago by sentry.io

Performance tracing integration for the drift SQL package using Sentry.

WASM-ready
$ flutter pub add sentry_drift
Source repository

What it does

Adds support for performance tracing to the drift package by intercepting database queries and sending them to Sentry. It helps developers monitor SQL query performance and track database operations within transactions.

AI-written summary of version 10.3.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You are using the drift package for local database storage and already use Sentry for error tracking or performance monitoring.
  • You need to trace and monitor the performance of SQL queries in your application.

Skip it when

  • You are not using the drift package.
  • You do not use Sentry for monitoring or performance tracing.

Strengths

  • Seamlessly integrates drift with Sentry performance tracing.
  • Easy to set up with existing Sentry and drift configurations.

Weaknesses

  • Strictly tied to the Sentry ecosystem.
  • Dependent on both sentry and drift packages functioning correctly together.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
3

Initialize the Sentry SDK with a valid DSN and wrap your drift database executor with SentryQueryInterceptor.

Future<void> main() async {
  const dsn = 'YOUR_DSN';
  await Sentry.init(
    (options) {
      options.dsn = dsn;
      options.tracesSampleRate = 1.0;
    },
  );
  final executor = NativeDatabase.memory().interceptWith(
    SentryQueryInterceptor(databaseName: 'my_db_name'),
  );
  final db = AppDatabase(executor);
}

Alternatives

Packages that do the same job and could replace sentry_drift.

Works with

Packages commonly used together with sentry_drift: ones it builds on, ones built on it, and its own family.