datalocal_for_supabase 0.1.0 copy "datalocal_for_supabase: ^0.1.0" to clipboard
datalocal_for_supabase: ^0.1.0 copied to clipboard

Supabase synchronization and local materialized views for DataLocal.

example/datalocal_for_supabase_example.dart

import 'package:datalocal/datalocal.dart';
import 'package:datalocal_for_supabase/datalocal_for_supabase.dart';
import 'package:supabase_flutter/supabase_flutter.dart';

Future<void> startProductCache() async {
  final database = await DataLocalDatabase.open(
    name: 'my_app',
    storage: DataLocalSharedPreferencesAsyncStorage(),
  );
  final products = database.mapCollection('products');
  final source = DataLocalSupabaseTableSource(
    client: Supabase.instance.client,
    table: 'products',
    primaryKey: 'id',
  );
  final sync = DataLocalSupabaseAdapter(
    localCollection: products,
    source: source,
    primaryKey: 'id',
  );

  await sync.pull();
  sync.watch();
}
1
likes
160
points
164
downloads

Documentation

API reference

Publisher

verified publisherlamun.my.id

Weekly Downloads

Supabase synchronization and local materialized views for DataLocal.

Repository (GitHub)
View/report issues

Topics

#cache #database #offline #postgres #supabase

License

MIT (license)

Dependencies

collection, datalocal, flutter, supabase_flutter

More

Packages that depend on datalocal_for_supabase