ConnectionConfig class final
A single named connection (config/database.php parity).
Constructors
-
ConnectionConfig({required String driver, required String database, String? host, int? port, String? username, String? password, Map<
String, Object?> options = const <String, Object?>{}}) -
const
- ConnectionConfig.fromUrl(String url, {String basePath = '.'})
-
A connection from a URL, as Laravel's
DB_URL:pgsql://user:secret@host:5432/app?sslmode=require&pool=5,mysql://user@host/app,mariadb://...,sqlite:database/app.sqliteorsqlite::memory:. User and password are URL-decoded; a relative SQLite path resolves againstbasePath.factory
Properties
- database → String
-
final
- driver → String
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String?
-
final
-
options
→ Map<
String, Object?> -
final
- password → String?
-
final
- port → int?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- username → String?
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, Object?> -
toString(
) → String -
A string representation of this object.
inherited
-
withUrl(
String url, {String basePath = '.'}) → ConnectionConfig -
This connection with what
urlgives, merged as Laravel 12'sConfigurationUrlParserdoes forDB_URL: the scheme sets the driver (postgres/postgresql→pgsql,mysql2→mysql,sqlite3→sqlite), the host, port, user, password and database it contains replace this connection's, and its query string adds options. Parts the URL leaves out keep their values.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited