Skip to content
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
1 change: 1 addition & 0 deletions crates/core/src/view_admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ DELETE FROM ps_untyped;
DELETE FROM ps_updated_rows;
DELETE FROM ps_kv WHERE key != 'client_id';
DELETE FROM ps_sync_state;
DELETE FROM ps_stream_subscriptions;
",
)?;

Expand Down
14 changes: 14 additions & 0 deletions dart/test/sync_stream_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -648,4 +648,18 @@ void main() {
}
]));
});

syncTest('clearing database clears subscriptions', (_) {
control(
'subscriptions',
json.encode({
'subscribe': {
'stream': {'name': 'a'},
}
}),
);
expect(db.select('select * from ps_stream_subscriptions'), isNotEmpty);
db.execute('select powersync_clear(0);');
expect(db.select('select * from ps_stream_subscriptions'), isEmpty);
});
}
Loading