DatabaseOption class

Configuration options for database connections.

This class holds all necessary parameters to establish a connection to a PostgreSQL or Supabase database, including authentication credentials, connection details, and SSL preferences.

Usage

Typically created by loading from environment variables:

final dbOption = DatabaseOption(
  userName: 'postgres',
  password: 'your_password',
  host: 'localhost',
  port: 5432,
  db: 'your_database',
  schema: 'public',
  useSSL: false,
);

Constructors

DatabaseOption.new({required String userName, required String schema, required String password, required String host, required int port, required String db, bool? useSSL})
Creates a new DatabaseOption instance.

Properties

db String
The database name to connect to.
final
hashCode int
The hash code for this object.
no setterinherited
host String
The database host address (e.g., 'localhost', 'db.supabase.co').
final
password String
The database password for authentication.
final
port int
The database port number (typically 5432 for PostgreSQL).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schema String
The database schema to query (e.g., 'public', 'auth').
final
userName String
The database username for authentication.
final
useSSL bool?
Whether to use SSL/TLS for the database connection.
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