Skip to content

Commit 7ed332f

Browse files
committed
Register close hook when opening db
1 parent 3f13001 commit 7ed332f

11 files changed

+3
-35
lines changed

dart/test/crud_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ void main() {
1313
db = openTestDatabase();
1414
});
1515

16-
tearDown(() {
17-
db.close();
18-
});
19-
2016
test('powersync_diff - single value', () {
2117
var r1 =
2218
db.select('select powersync_diff(?, ?) as diff', ['{}', '{}']).first;

dart/test/error_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ void main() {
1212
db = openTestDatabase();
1313
});
1414

15-
tearDown(() {
16-
db.close();
17-
});
18-
1915
test('contain inner SQLite descriptions', () {
2016
// Create a wrong migrations table for the core extension to trip over.
2117
db.execute('CREATE TABLE IF NOT EXISTS ps_migration(foo TEXT)');

dart/test/js_key_encoding_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ void main() {
2626
..select('select powersync_replace_schema(?)', [json.encode(_schema)]);
2727
});
2828

29-
tearDown(() {
30-
db.close();
31-
});
32-
3329
test('can fix JS key encoding', () {
3430
db.execute('insert into powersync_operations (op, data) VALUES (?, ?);', [
3531
'save',

dart/test/legacy_sync_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ void main() {
3030
..select('select powersync_replace_schema(?)', [json.encode(_schema)]);
3131
});
3232

33-
tearDown(() {
34-
db.close();
35-
});
36-
3733
void pushSyncData(
3834
String bucket,
3935
String opId,

dart/test/migration_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ void main() {
2222
db = openTestDatabase();
2323
});
2424

25-
tearDown(() {
26-
db.close();
27-
});
28-
2925
/// This tests that the extension can load
3026
test('extension setup', () async {
3127
final row1 = db.select('select sqlite_version() as version').first;

dart/test/schema_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ void main() {
1212
db = openTestDatabase();
1313
});
1414

15-
tearDown(() {
16-
db.close();
17-
});
18-
1915
group('Schema Tests', () {
2016
test('Schema versioning', () {
2117
// Test that powersync_replace_schema() is a no-op when the schema is not

dart/test/sync_local_performance_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ void testFilesystemOperations(
4040
});
4141

4242
tearDown(() {
43-
db.close();
4443
sqlite3.unregisterVirtualFileSystem(vfs);
4544
});
4645

dart/test/sync_stream_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ void main() {
3030
['client_id', 'test-test-test-test']);
3131
});
3232

33-
tearDown(() {
34-
db.close();
35-
});
36-
3733
List<Object?> control(String operation, Object? data) {
3834
db.execute('begin');
3935
ResultSet result;

dart/test/sync_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ void _syncTests<T>({
8484

8585
tearDown(() {
8686
matcher.finish();
87-
db.close();
8887
});
8988

9089
List<Object?> syncLine(Object? line) {

dart/test/update_hooks_test.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ void main() {
1515
..select("SELECT powersync_update_hooks('install')");
1616
});
1717

18-
tearDown(() {
19-
db.close();
20-
});
21-
2218
List<String> collectUpdates() {
2319
final [row] = db.select("SELECT powersync_update_hooks('get')");
2420
return (json.decode(row.values[0] as String) as List).cast();

0 commit comments

Comments
 (0)