Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecate: drift SentryQueryExecutor #2715

Merged
merged 5 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@

### Deprecations

- Deprecate Drift `SentryQueryExecutor` ([#2715](https://github.com/getsentry/sentry-dart/pull/2715))
- This will be replace by `SentryQueryInterceptor` in the next major v9
```dart
// Example usage in Sentry Flutter v9
final executor = NativeDatabase.memory().interceptWith(
SentryQueryInterceptor(databaseName: 'your_db_name'),
);

final db = AppDatabase(executor);
```
- Deprecate `autoAppStart` and `setAppStartEnd` ([#2681](https://github.com/getsentry/sentry-dart/pull/2681))

### Other
Expand Down
3 changes: 3 additions & 0 deletions drift/lib/src/sentry_query_executor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ typedef DatabaseOpener = FutureOr<QueryExecutor> Function();
/// If the constructor parameter queryExecutor is null, [LazyDatabase] will be
/// used as a default.
@experimental
@Deprecated(
'This will be replaced by SentryQueryInterceptor in the next major v9 '
'where you can use executor.interceptWith(...) to attach the SentryQueryInterceptor')
class SentryQueryExecutor extends QueryExecutor {
Hub _hub;

Expand Down
3 changes: 2 additions & 1 deletion drift/lib/src/sentry_span_helper.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:meta/meta.dart';
// ignore_for_file: deprecated_member_use_from_same_package

import 'package:meta/meta.dart';
import 'package:sentry/sentry.dart';

import 'sentry_query_executor.dart';
Expand Down
2 changes: 1 addition & 1 deletion drift/test/sentry_database_test.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ignore_for_file: invalid_use_of_internal_member, library_annotations
// ignore_for_file: invalid_use_of_internal_member, library_annotations, deprecated_member_use_from_same_package

@TestOn('vm')

Expand Down
1 change: 1 addition & 0 deletions flutter/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ class MainScaffold extends StatelessWidget {
bindToScope: true,
);

// ignore: deprecated_member_use
final executor = SentryQueryExecutor(
() async => inMemoryExecutor(),
databaseName: 'sentry_in_memory_db',
Expand Down
Loading