Skip to content

Commit 8f71635

Browse files
authored
- Remove unused powersync db from connectors in demos (#168)
- Remove old web directory
1 parent 4684b76 commit 8f71635

File tree

14 files changed

+18
-125
lines changed

14 files changed

+18
-125
lines changed

demos/django-todolist/lib/powersync.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ final List<RegExp> fatalResponseCodes = [
2525
];
2626

2727
class DjangoConnector extends PowerSyncBackendConnector {
28-
PowerSyncDatabase db;
29-
30-
DjangoConnector(this.db);
28+
DjangoConnector();
3129

3230
final ApiClient apiClient = ApiClient(AppConfig.djangoUrl);
3331

@@ -123,7 +121,7 @@ Future<void> openDatabase() async {
123121
if (await isLoggedIn()) {
124122
// If the user is already logged in, connect immediately.
125123
// Otherwise, connect once logged in.
126-
currentConnector = DjangoConnector(db);
124+
currentConnector = DjangoConnector();
127125
db.connect(connector: currentConnector);
128126
}
129127
}

demos/supabase-anonymous-auth/lib/powersync.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ final List<RegExp> fatalResponseCodes = [
2727

2828
/// Use Supabase for authentication and data upload.
2929
class SupabaseConnector extends PowerSyncBackendConnector {
30-
PowerSyncDatabase db;
31-
3230
// ignore: unused_field
3331
Future<void>? _refreshFuture;
3432

35-
SupabaseConnector(this.db);
33+
SupabaseConnector();
3634

3735
/// Get a Supabase token to authenticate against the PowerSync instance.
3836
@override
@@ -152,5 +150,5 @@ Future<void> openDatabase() async {
152150

153151
await loadSupabase();
154152

155-
db.connect(connector: SupabaseConnector(db));
153+
db.connect(connector: SupabaseConnector());
156154
}

demos/supabase-edge-function-auth/lib/powersync.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ final List<RegExp> fatalResponseCodes = [
2626

2727
/// Use Supabase for authentication and data upload.
2828
class SupabaseConnector extends PowerSyncBackendConnector {
29-
PowerSyncDatabase db;
30-
3129
// ignore: unused_field
3230
Future<void>? _refreshFuture;
3331

34-
SupabaseConnector(this.db);
32+
SupabaseConnector();
3533

3634
/// Get a Supabase token to authenticate against the PowerSync instance.
3735
@override
@@ -160,15 +158,15 @@ Future<void> openDatabase() async {
160158
if (isLoggedIn()) {
161159
// If the user is already logged in, connect immediately.
162160
// Otherwise, connect once logged in.
163-
currentConnector = SupabaseConnector(db);
161+
currentConnector = SupabaseConnector();
164162
db.connect(connector: currentConnector);
165163
}
166164

167165
Supabase.instance.client.auth.onAuthStateChange.listen((data) async {
168166
final AuthChangeEvent event = data.event;
169167
if (event == AuthChangeEvent.signedIn) {
170168
// Connect to PowerSync when the user is signed in
171-
currentConnector = SupabaseConnector(db);
169+
currentConnector = SupabaseConnector();
172170
db.connect(connector: currentConnector!);
173171
} else if (event == AuthChangeEvent.signedOut) {
174172
// Implicit sign out - disconnect, but don't delete data

demos/supabase-simple-chat/lib/powersync.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ Future<void> openDatabase() async {
4747
SupabaseConnector? currentConnector;
4848

4949
if (isLoggedIn()) {
50-
currentConnector = SupabaseConnector(db);
50+
currentConnector = SupabaseConnector();
5151
db.connect(connector: currentConnector);
5252
}
5353

5454
Supabase.instance.client.auth.onAuthStateChange.listen((data) async {
5555
final AuthChangeEvent event = data.event;
5656
if (event == AuthChangeEvent.signedIn) {
57-
currentConnector = SupabaseConnector(db);
57+
currentConnector = SupabaseConnector();
5858
db.connect(connector: currentConnector!);
5959
} else if (event == AuthChangeEvent.signedOut) {
6060
currentConnector = null;
@@ -66,8 +66,7 @@ Future<void> openDatabase() async {
6666
}
6767

6868
class SupabaseConnector extends PowerSyncBackendConnector {
69-
PowerSyncDatabase db;
70-
SupabaseConnector(this.db);
69+
SupabaseConnector();
7170

7271
@override
7372
Future<void> uploadData(PowerSyncDatabase database) async {

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ final List<RegExp> fatalResponseCodes = [
2828

2929
/// Use Supabase for authentication and data upload.
3030
class SupabaseConnector extends PowerSyncBackendConnector {
31-
PowerSyncDatabase db;
32-
3331
Future<void>? _refreshFuture;
3432

35-
SupabaseConnector(this.db);
33+
SupabaseConnector();
3634

3735
/// Get a Supabase token to authenticate against the PowerSync instance.
3836
@override
@@ -172,15 +170,15 @@ Future<void> openDatabase() async {
172170
if (isLoggedIn()) {
173171
// If the user is already logged in, connect immediately.
174172
// Otherwise, connect once logged in.
175-
currentConnector = SupabaseConnector(db);
173+
currentConnector = SupabaseConnector();
176174
db.connect(connector: currentConnector);
177175
}
178176

179177
Supabase.instance.client.auth.onAuthStateChange.listen((data) async {
180178
final AuthChangeEvent event = data.event;
181179
if (event == AuthChangeEvent.signedIn) {
182180
// Connect to PowerSync when the user is signed in
183-
currentConnector = SupabaseConnector(db);
181+
currentConnector = SupabaseConnector();
184182
db.connect(connector: currentConnector!);
185183
} else if (event == AuthChangeEvent.signedOut) {
186184
// Implicit sign out - disconnect, but don't delete data

demos/supabase-todolist-optional-sync/lib/powersync.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ final List<RegExp> fatalResponseCodes = [
2727

2828
/// Use Supabase for authentication and data upload.
2929
class SupabaseConnector extends PowerSyncBackendConnector {
30-
PowerSyncDatabase db;
31-
3230
Future<void>? _refreshFuture;
3331

34-
SupabaseConnector(this.db);
32+
SupabaseConnector();
3533

3634
/// Get a Supabase token to authenticate against the PowerSync instance.
3735
@override
@@ -189,7 +187,7 @@ Future<void> connectDatabase() async {
189187
await switchToSyncedSchema(db, getUserId());
190188
}
191189

192-
currentConnector = SupabaseConnector(db);
190+
currentConnector = SupabaseConnector();
193191
await db.connect(connector: currentConnector);
194192

195193
Supabase.instance.client.auth.onAuthStateChange.listen((data) async {
-917 Bytes
Binary file not shown.
-5.17 KB
Binary file not shown.
-8.06 KB
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)