PostgresEndpoint class final Getting Started

A resolved Postgres connection endpoint, parsed from the database: options of basalt.yaml.

Two mutually exclusive option shapes are supported:

database:
  url: postgres://user:secret@localhost:5432/shop?sslmode=disable

or manual keys:

database:
  host: localhost      # default: localhost
  port: 5432           # default: 5432
  database: shop       # required
  username: postgres   # default: postgres
  password: secret     # default: empty
  ssl: false           # default: true

Constructors

PostgresEndpoint({required String host, required int port, required String database, required String username, required String password, required bool ssl})
const
PostgresEndpoint.fromOptions(Map<String, Object?> options)
Parses options — either a lone url key or manual keys; mixing the two (or passing an unknown key) throws ArgumentError.
factory

Properties

database String
final
hashCode int
The hash code for this object.
no setterinherited
host String
final
password String
final
port int
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
ssl bool
Whether to require SSL (sslmode=disable / ssl: false opts out).
final
username String
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited