You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey Supabase team, this isn't a bug report or a feature request. We've added offline functionality to the Supabase client in Brick, and I wanted to share it with the larger community.
Brick caches remote data locally so that apps always function the same offline as they do online. Models are defined in Dart while generated code handles the Supabase/SQLite querying under the hood; the application then uses a simple ORM to work with data (and even react to data). If a request is made offline, it's retried until the client comes back online.
The Brick Supabase integration adds this generation and querying capability for Supabase apps with a straightforward setup. But Supabase's client can still made offline without using Brick:
import'package:brick_offline_first_with_rest/offline_queue.dart';
import'package:sqflite/sqflite.dart'show databaseFactory;
import'package:http/http.dart'as http;
final client =RestOfflineQueueClient(
http.Client(),
RestRequestSqliteCacheManager(
'brick_offline_queue.sqlite',
databaseFactory: databaseFactory,
),
// Don't retry auth or storage requests; optionally add '/functions/v1' to not retry functions
ignorePaths: {'/auth/v1','/storage/v1'},
);
final queue =RestOfflineRequestQueue(client: client);
awaitSupabase.initialize(..., httpClient: client); // or SupabaseClient(..., httpClient: client)await client.requestManager.migrate();
queue.start();
If this is useful, I'd be happy to write a blog or more thorough example app to illustrate using Supabase while offline.
Sorry for opening an issue if this was the wrong place; I don't have Twitter and didn't see a link/email in the Supa Update newsletter to submit community work (although it would be a great honor if Brick's Supabase integration was mentioned in September's update). cc @devj3ns
The text was updated successfully, but these errors were encountered:
Hey Supabase team, this isn't a bug report or a feature request. We've added offline functionality to the Supabase client in Brick, and I wanted to share it with the larger community.
Brick caches remote data locally so that apps always function the same offline as they do online. Models are defined in Dart while generated code handles the Supabase/SQLite querying under the hood; the application then uses a simple ORM to work with data (and even react to data). If a request is made offline, it's retried until the client comes back online.
The Brick Supabase integration adds this generation and querying capability for Supabase apps with a straightforward setup. But Supabase's client can still made offline without using Brick:
If this is useful, I'd be happy to write a blog or more thorough example app to illustrate using Supabase while offline.
Sorry for opening an issue if this was the wrong place; I don't have Twitter and didn't see a link/email in the Supa Update newsletter to submit community work (although it would be a great honor if Brick's Supabase integration was mentioned in September's update). cc @devj3ns
The text was updated successfully, but these errors were encountered: