DpgsqlDataSource class
Represents a source of data for Dpgsql, which can be used to create
connections. Handles connection pooling when Pooling=true.
Constructors
- DpgsqlDataSource(String connectionString, {DpgsqlConnectionCallback? onOpen})
- DpgsqlDataSource.fromConnectionStringBuilder(DpgsqlConnectionStringBuilder builder, {DpgsqlConnectionCallback? onOpen})
- Creates a data source from an already configured builder, avoiding the need to serialize options to a connection string.
Properties
- busyCount → int
-
no setter
- connectionIdleLifetime → Duration
-
final
- connectionLifetime → Duration
-
final
- connectionPruningInterval → Duration
-
final
- connectionString → String
-
final
- connectionTimeout → Duration
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- idleCount → int
-
no setter
- maxPoolSize → int
-
final
- minPoolSize → int
-
final
- onOpen → DpgsqlConnectionCallback?
-
final
- pooling → bool
-
final
-
poolStats
→ Map<
String, dynamic> -
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- totalConnectionsCreated → int
-
no setter
- totalConnectionsFailed → int
-
no setter
- totalConnectionsReused → int
-
no setter
- totalConnectionTimeouts → int
-
no setter
- totalConnectionWaits → int
-
no setter
- totalCount → int
-
no setter
- waitingCount → int
-
no setter
Methods
-
closeIdleConnections(
) → Future< void> -
createCommand(
[String commandText = '']) → DpgsqlCommand - Creates a command associated with a new unopened connection.
-
createConnection(
) → DpgsqlConnection - Creates an unopened connection using this data source's connection string.
-
dispose(
) → Future< void> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
openConnection(
) → Future< DpgsqlConnection> - Opens a connection to the database. If the pool is exhausted, waits until another caller closes a pooled connection or connectionTimeout elapses.
-
toString(
) → String -
A string representation of this object.
inherited
-
warmup(
[int? count]) → Future< void> -
Pre-creates idle connections up to
count, orMinimum Pool Sizewhen omitted. This is explicit because Dart constructors cannot await.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
create(
String connectionString) → DpgsqlDataSource -
createFromBuilder(
DpgsqlConnectionStringBuilder connectionStringBuilder) → DpgsqlDataSource