postgrest_errors 0.1.0+1 copy "postgrest_errors: ^0.1.0+1" to clipboard
postgrest_errors: ^0.1.0+1 copied to clipboard

A generated collection of all PostgREST errors definitions.

example/main.dart

import 'dart:convert';

import 'package:http/http.dart' as http;
import 'package:postgrest_errors/postgrest_errors.dart';

void main() async {
  // Make a request to PostgREST server:
  final client = http.Client();
  final response = await client.get(
    Uri.parse('http://localhost:3000'), // PostgREST server
  );

  // Parse the response error as a Dart exception:
  if (response.statusCode != 200) {
    final json = jsonDecode(response.body) as Map<String, dynamic>;
    throw PostgrestError.fromJson(json);
  }
}
3
likes
0
points
25
downloads

Publisher

verified publisheralestiago.com

Weekly Downloads

A generated collection of all PostgREST errors definitions.

Repository (GitHub)
View/report issues

Topics

#server #backend #postgrest #supabase

Documentation

Documentation

License

unknown (license)

Dependencies

postgrest

More

Packages that depend on postgrest_errors