supabase_gen 1.6.0 copy "supabase_gen: ^1.6.0" to clipboard
supabase_gen: ^1.6.0 copied to clipboard

A Dart package that generates Flutter repositories and models from Supabase database. Compatible with latest Supabase Flutter SDK. Requires supabase_flutter ^2.8.4 as a dependency in your app.

1.6.0 #

Added #

  • Enhanced findAll method in generated repositories to support filtering
  • Added optional filters parameter of type Map<String, dynamic> to findAll method
  • Filtering can be combined with existing pagination and sorting parameters
  • All repositories now inherit filtering capability from base repository
  • Added new foreign key methods for more flexible querying:
    • findBy{ForeignKey}Field methods for each foreign key with pagination, sorting, and additional filtering support
    • These complement existing findBy{ForeignKey} methods that find related parent records

Example - Basic Filtering #

// Filter by single field
final results = await repository.findAll(
  filters: {'status': 'active'}
);

// Combine with pagination and sorting
final results = await repository.findAll(
  filters: {'category': 'residential'},
  limit: 10,
  offset: 0,
  orderBy: 'created_at',
  ascending: false
);

Example - Foreign Key Methods #

// Find quotes for a specific bill with additional filters
final quotes = await quotesRepository.findByBillIdField(
  billId,
  limit: 10,
  orderBy: 'created_at',
  additionalFilters: {'status': 'pending'}
);

// Find the parent bill for a quote (existing functionality)
final bills = await quotesRepository.findByBillId(billId);
1
likes
40
points
65
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart package that generates Flutter repositories and models from Supabase database. Compatible with latest Supabase Flutter SDK. Requires supabase_flutter ^2.8.4 as a dependency in your app.

Repository (GitHub)

License

MIT (license)

Dependencies

args, logging, path, postgres, recase, supabase_flutter, yaml

More

Packages that depend on supabase_gen