PostgresConnection class Null safety
PostgreSQL connection using plain driver.
By defining a connection and sharing it through multiple persistence components you can reduce number of used database connections.
Configuration parameters
connection(s)
:discovery_key
: (optional) a key to retrieve the connection from IDiscoveryhost
: host name or IP addressport
: port number (default: 5432)uri
: resource URI or connection string with all parameters in it
credential(s)
:store_key
: (optional) a key to retrieve the credentials from ICredentialStoreusername
: user namepassword
: user password
options
:connect_timeout
: (optional) number of milliseconds to wait before timing out when connecting a new client (default: 10000)idle_timeout
: (optional) number of milliseconds a client must sit idle in the pool and not be checked out (default: 10000)max_pool_size
: (optional) maximum number of clients the pool should contain (default: 10)
References
- *:logger:*:*:1.0 (optional) ILogger components to pass log messages
- *:discovery:*:*:1.0 (optional) IDiscovery services
- *:credential-store:*:*:1.0 (optional) Credential stores to resolve credentials
- Implemented types
Constructors
Properties
- connection_ ↔ PostgreSQLConnection?
-
read / write
- connectionResolver_ ↔ PostgresConnectionResolver
-
read / write
- databaseName_ ↔ String?
-
read / write
- hashCode → int
-
The hash code for this object. [...]
read-only, inherited
- logger_ ↔ CompositeLogger
-
read / write
- options_ ↔ ConfigParams
-
read / write
- runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Methods
-
close(
String? correlationId) → Future -
Closes component and frees used resources. [...]
override
-
configure(
ConfigParams config) → void -
Configures component by passing configuration parameters. [...]
override
-
getConnection(
) → PostgreSQLConnection? -
getDatabaseName(
) → String? -
isOpen(
) → bool -
Checks if the component is opened. [...]
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed. [...]
inherited
-
open(
String? correlationId) → Future -
Opens the component. [...]
override
-
setReferences(
IReferences references) → void -
Sets references to dependent components. [...]
override
-
toString(
) → String -
A string representation of this object. [...]
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator. [...]
inherited