Skip to content

Commit d5bc792

Browse files
authored
Merge pull request #66 from davidmartos96/log_statements
Support passing `logStatements` to drift
2 parents eb144be + a243899 commit d5bc792

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/drift_sqlite_async/lib/src/connection.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import 'package:sqlite_async/sqlite_async.dart';
1515
class SqliteAsyncDriftConnection extends DatabaseConnection {
1616
late StreamSubscription _updateSubscription;
1717

18-
SqliteAsyncDriftConnection(SqliteConnection db)
19-
: super(SqliteAsyncQueryExecutor(db)) {
18+
SqliteAsyncDriftConnection(SqliteConnection db, {bool logStatements = false})
19+
: super(SqliteAsyncQueryExecutor(db, logStatements: logStatements)) {
2020
_updateSubscription = (db as SqliteQueries).updates!.listen((event) {
2121
var setUpdates = <TableUpdate>{};
2222
for (var tableName in event.tables) {

packages/drift_sqlite_async/lib/src/executor.dart

+2-4
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,8 @@ class _SqliteAsyncVersionDelegate extends DynamicVersionDelegate {
127127
/// Extnral update notifications from the [SqliteConnection] are _not_ forwarded
128128
/// automatically - use [SqliteAsyncDriftConnection] for that.
129129
class SqliteAsyncQueryExecutor extends DelegatedDatabase {
130-
SqliteAsyncQueryExecutor(SqliteConnection db)
131-
: super(
132-
_SqliteAsyncDelegate(db),
133-
);
130+
SqliteAsyncQueryExecutor(SqliteConnection db, {bool logStatements = false})
131+
: super(_SqliteAsyncDelegate(db), logStatements: logStatements);
134132

135133
/// The underlying SqliteConnection used by drift to send queries.
136134
SqliteConnection get db {

0 commit comments

Comments
 (0)