File tree Expand file tree Collapse file tree 4 files changed +14
-11
lines changed Expand file tree Collapse file tree 4 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 1
1
import 'dart:async' ;
2
- import 'package:sqlite_async/sqlite3.dart' ;
3
- import 'package:sqlite_async/sqlite3_common.dart' as sqlite;
2
+ import 'package:sqlite_async/sqlite3_common.dart' ;
4
3
import 'package:sqlite_async/src/common/mutex.dart' ;
5
4
import 'package:sqlite_async/src/common/abstract_open_factory.dart' ;
6
5
import 'package:sqlite_async/src/impl/isolate_connection_factory_impl.dart' ;
7
6
import 'package:sqlite_async/src/sqlite_connection.dart' ;
8
7
import 'port_channel.dart' ;
9
8
10
- mixin IsolateOpenFactoryMixin <Database extends sqlite. CommonDatabase > {
9
+ mixin IsolateOpenFactoryMixin <Database extends CommonDatabase > {
11
10
AbstractDefaultSqliteOpenFactory <Database > get openFactory;
12
11
13
12
/// Opens a synchronous sqlite.Database directly in the current isolate.
@@ -24,8 +23,8 @@ mixin IsolateOpenFactoryMixin<Database extends sqlite.CommonDatabase> {
24
23
}
25
24
26
25
/// A connection factory that can be passed to different isolates.
27
- abstract class IsolateConnectionFactory <Database extends sqlite. CommonDatabase >
28
- with IsolateOpenFactoryMixin < Database > {
26
+ abstract class IsolateConnectionFactory <Database extends CommonDatabase >
27
+ with IsolateOpenFactoryMixin {
29
28
Mutex get mutex;
30
29
31
30
SerializedPortClient get upstreamPort;
Original file line number Diff line number Diff line change 1
1
import 'dart:async' ;
2
2
3
- import 'package:sqlite3/sqlite3 .dart' as sqlite ;
3
+ import 'package:sqlite_async/sqlite3_common .dart' ;
4
4
import 'package:sqlite_async/src/common/isolate_connection_factory.dart' ;
5
5
import 'package:sqlite_async/src/common/mutex.dart' ;
6
6
import 'package:sqlite_async/src/common/abstract_open_factory.dart' ;
7
7
import 'package:sqlite_async/src/common/port_channel.dart' ;
8
8
import 'package:sqlite_async/src/sqlite_connection.dart' ;
9
9
10
10
/// A connection factory that can be passed to different isolates.
11
- class IsolateConnectionFactoryImpl implements IsolateConnectionFactory {
11
+ class IsolateConnectionFactoryImpl <Database extends CommonDatabase >
12
+ implements IsolateConnectionFactory <Database > {
12
13
@override
13
14
AbstractDefaultSqliteOpenFactory openFactory;
14
15
@@ -34,7 +35,7 @@ class IsolateConnectionFactoryImpl implements IsolateConnectionFactory {
34
35
/// 2. Other connections are not notified of any updates to tables made within
35
36
/// this connection.
36
37
@override
37
- Future <sqlite. Database > openRawDatabase ({bool readOnly = false }) async {
38
+ Future <Database > openRawDatabase ({bool readOnly = false }) async {
38
39
throw UnimplementedError ();
39
40
}
40
41
Original file line number Diff line number Diff line change 1
1
import 'package:sqlite_async/sqlite3.dart' as sqlite;
2
+ import 'package:sqlite_async/sqlite3_common.dart' ;
2
3
3
4
import 'package:sqlite_async/src/common/abstract_open_factory.dart' ;
4
5
import 'package:sqlite_async/src/native/database/native_sqlite_connection_impl.dart' ;
@@ -12,7 +13,7 @@ class DefaultSqliteOpenFactory extends AbstractDefaultSqliteOpenFactory {
12
13
super .sqliteOptions = const SqliteOptions .defaults ()});
13
14
14
15
@override
15
- sqlite. Database openDB (SqliteOpenOptions options) {
16
+ CommonDatabase openDB (SqliteOpenOptions options) {
16
17
final mode = options.openMode;
17
18
var db = sqlite.sqlite3.open (path, mode: mode, mutex: false );
18
19
return db;
Original file line number Diff line number Diff line change 1
1
import 'dart:async' ;
2
2
3
3
import 'package:sqlite3/common.dart' as sqlite;
4
+ import 'package:sqlite_async/sqlite3_common.dart' ;
4
5
import 'package:sqlite_async/src/update_notification.dart' ;
5
6
6
7
/// Abstract class representing calls available in a read-only or read-write context.
7
- abstract class SqliteReadContext < Database extends sqlite. CommonDatabase > {
8
+ abstract class SqliteReadContext {
8
9
/// Execute a read-only (SELECT) query and return the results.
9
10
Future <sqlite.ResultSet > getAll (String sql,
10
11
[List <Object ?> parameters = const []]);
@@ -57,7 +58,8 @@ abstract class SqliteReadContext<Database extends sqlite.CommonDatabase> {
57
58
/// });
58
59
/// }
59
60
/// ```
60
- Future <T > computeWithDatabase <T >(Future <T > Function (Database db) compute);
61
+ Future <T > computeWithDatabase <T >(
62
+ Future <T > Function (CommonDatabase db) compute);
61
63
}
62
64
63
65
/// Abstract class representing calls available in a read-write context.
You can’t perform that action at this time.
0 commit comments