Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 48da58c

Browse files
committedJun 19, 2025·
Adopt in supabase demo
1 parent 0053607 commit 48da58c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎demos/supabase-todolist/lib/powersync.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ Future<String> getDatabasePath() async {
153153
return join(dir.path, dbFilename);
154154
}
155155

156+
const options = SyncOptions(syncImplementation: SyncClientImplementation.rust);
157+
156158
Future<void> openDatabase() async {
157159
// Open the local database
158160
db = PowerSyncDatabase(
@@ -167,15 +169,15 @@ Future<void> openDatabase() async {
167169
// If the user is already logged in, connect immediately.
168170
// Otherwise, connect once logged in.
169171
currentConnector = SupabaseConnector();
170-
db.connect(connector: currentConnector);
172+
db.connect(connector: currentConnector, options: options);
171173
}
172174

173175
Supabase.instance.client.auth.onAuthStateChange.listen((data) async {
174176
final AuthChangeEvent event = data.event;
175177
if (event == AuthChangeEvent.signedIn) {
176178
// Connect to PowerSync when the user is signed in
177179
currentConnector = SupabaseConnector();
178-
db.connect(connector: currentConnector!);
180+
db.connect(connector: currentConnector!, options: options);
179181
} else if (event == AuthChangeEvent.signedOut) {
180182
// Implicit sign out - disconnect, but don't delete data
181183
currentConnector = null;

0 commit comments

Comments
 (0)
Please sign in to comment.