DatabaseConfig class final
Database configuration section.
- Implemented types
Constructors
-
DatabaseConfig({required String defaultConnection, required Map<
String, ConnectionConfig> connections}) -
const
- DatabaseConfig.fromEnv(Env env, {required String basePath})
-
Reads
DB_*variables.DB_CONNECTIONselects the default connection (sqliteby default). Relative SQLite paths resolve againstbasePath.factory
Properties
-
connections
→ Map<
String, ConnectionConfig> -
final
- defaultConnection → String
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → String
-
Top-level key of the section, e.g.
appordatabase.no setteroverride - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
Whether the default connection is a SQLite file that
isolatesisolates would share. It works (WAL,busy_timeout), but a writer waiting for another isolate's lock blocks its whole event loop, since SQLite calls are synchronous: for production with several isolates, PostgreSQL (or MySQL) is the database to use. -
toMap(
) → Map< String, Object?> -
Plain-map projection used for dot-notation access.
override
-
toString(
) → String -
A string representation of this object.
inherited
-
withConnections(
Map< String, ConnectionConfig> extra) → DatabaseConfig -
This configuration with
extraconnections added (or replacing ones of the same name).
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
check(
Env env, ConfigRepository config) → Iterable< ConfigIssue> -
Boot check:
DB_CONNECTIONmust name a configured connection.