From 161b99d8d584d9d99d1024cab9f59210c84d839c Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Thu, 1 Sep 2022 18:57:36 +0200 Subject: [PATCH] Re-enable `public_member_api_docs` lint --- drift/analysis_options.yaml | 4 ++++ drift/lib/src/sqlite3/database.dart | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/drift/analysis_options.yaml b/drift/analysis_options.yaml index 4c1b5e9f..964a03af 100644 --- a/drift/analysis_options.yaml +++ b/drift/analysis_options.yaml @@ -5,3 +5,7 @@ analyzer: implicit-casts: false exclude: - "**/*.g.dart" + +linter: + rules: + public_member_api_docs: true diff --git a/drift/lib/src/sqlite3/database.dart b/drift/lib/src/sqlite3/database.dart index 8c304fa5..dc6f567d 100644 --- a/drift/lib/src/sqlite3/database.dart +++ b/drift/lib/src/sqlite3/database.dart @@ -14,12 +14,19 @@ import 'native_functions.dart'; /// through `package:js`. abstract class Sqlite3Delegate extends DatabaseDelegate { + /// The underlying database instance from the `sqlite3` package. late DB database; bool _hasCreatedDatabase = false; bool _isOpen = false; final void Function(DB)? _setup; + + /// Whether the [database] should be closed when [close] is called on this + /// instance. + /// + /// This defaults to `true`, but can be disabled to virtually open multiple + /// connections to the same database. final bool closeUnderlyingWhenClosed; /// A delegate that will call [openDatabase] to open the database. @@ -70,6 +77,8 @@ abstract class Sqlite3Delegate versionDelegate = _VmVersionDelegate(database); } + /// Synchronously prepares and runs [statements] collected from a batch. + @protected void runBatchSync(BatchedStatements statements) { final prepared = []; @@ -90,6 +99,9 @@ abstract class Sqlite3Delegate } } + /// Synchronously prepares and runs a single [statement], replacing variables + /// with the given [args]. + @protected void runWithArgsSync(String statement, List args) { if (args.isEmpty) { database.execute(statement);