Skip to content

Support passing logStatements to drift #66

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

Merged
merged 1 commit into from
Oct 9, 2024
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
4 changes: 2 additions & 2 deletions packages/drift_sqlite_async/lib/src/connection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import 'package:sqlite_async/sqlite_async.dart';
class SqliteAsyncDriftConnection extends DatabaseConnection {
late StreamSubscription _updateSubscription;

SqliteAsyncDriftConnection(SqliteConnection db)
: super(SqliteAsyncQueryExecutor(db)) {
SqliteAsyncDriftConnection(SqliteConnection db, {bool logStatements = false})
: super(SqliteAsyncQueryExecutor(db, logStatements: logStatements)) {
_updateSubscription = (db as SqliteQueries).updates!.listen((event) {
var setUpdates = <TableUpdate>{};
for (var tableName in event.tables) {
Expand Down
6 changes: 2 additions & 4 deletions packages/drift_sqlite_async/lib/src/executor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,8 @@ class _SqliteAsyncVersionDelegate extends DynamicVersionDelegate {
/// Extnral update notifications from the [SqliteConnection] are _not_ forwarded
/// automatically - use [SqliteAsyncDriftConnection] for that.
class SqliteAsyncQueryExecutor extends DelegatedDatabase {
SqliteAsyncQueryExecutor(SqliteConnection db)
: super(
_SqliteAsyncDelegate(db),
);
SqliteAsyncQueryExecutor(SqliteConnection db, {bool logStatements = false})
: super(_SqliteAsyncDelegate(db), logStatements: logStatements);

/// The underlying SqliteConnection used by drift to send queries.
SqliteConnection get db {
Expand Down