postgrest 0.0.8 copy "postgrest: ^0.0.8" to clipboard
postgrest: ^0.0.8 copied to clipboard

outdated

PostgREST client for Dart. This library provides an ORM interface to PostgREST.

example/main.dart

import 'package:postgrest/postgrest.dart';
import 'package:postgrest/src/count_option.dart';

/// Example to use with Supabase API https://supabase.io/
dynamic main() async {
  const supabaseUrl = '';
  const supabaseKey = '';
  final client =
      PostgrestClient('$supabaseUrl/rest/v1', headers: {'apikey': supabaseKey}, schema: 'public');

  try {
    final response = await client.from('countries').select().execute(count: CountOption.exact);
    if (response.error != null) {
      throw response.error!;
    }
    return response.data;
  } on PostgrestError catch (e) {
    // handle PostgrestError
    print(e.code);
    print(e.message);
  }
}
103
likes
0
pub points
97%
popularity

Publisher

verified publishersupabase.io

PostgREST client for Dart. This library provides an ORM interface to PostgREST.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

http

More

Packages that depend on postgrest