postgres method

void postgres({
  1. required String url,
  2. required String anonKey,
})

Declares project-level generic Postgres backend configuration.

Generic Postgres and Supabase are mutually exclusive within one DSL app.

Implementation

void postgres({required String url, required String anonKey}) {
  if (_postgres != null) {
    throw StateError('Postgres has already been configured.');
  }
  if (_supabase != null) {
    throw StateError(
      'Postgres and Supabase are mutually exclusive in one DSL app.',
    );
  }
  _postgres = PostgresDeclaration(url: url, anonKey: anonKey);
}