PostgreSQLConnection class abstract
Instances of this class connect to and communicate with a PostgreSQL database.
The primary type of this library, a connection is responsible for connecting to databases and executing queries. A connection may be opened with open after it is created.
- Implemented types
- Annotations
-
- @Deprecated('Do not use v2 API, will be removed in next release.')
Constructors
Properties
- allowClearTextPassword → bool
-
If true, allows password in clear text for authentication.
no setter
- databaseName → String
-
Name of database this connection refers to.
no setter
- encoding → Encoding
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String
-
Hostname of database this connection refers to.
no setter
- isClosed → bool
-
Reports on the latest known status of the connection: whether it was open or failed for some reason.
no setter
- isUnixSocket → bool
-
If true, connection is made via unix socket.
no setter
-
messages
→ Stream<
ServerMessage> -
Stream of server messages
no setter
-
notifications
→ Stream<
Notification> -
Stream of notification from the database.
no setter
- password → String?
-
Password for authenticating this connection.
no setter
- port → int
-
Port of database this connection refers to.
no setter
- processID → int
-
The processID of this backend.
no setter
- queryTimeoutInSeconds → int
-
The default timeout for PostgreSQLExecutionContext's execute and query methods.
no setter
- queueSize → int
-
Returns this context queue size
no setterinherited
- replicationMode → ReplicationMode
-
The replication mode for connecting in streaming replication mode.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
settings
→ Map<
String, String> -
Settings values from the connected database.
final
- socket → Socket?
-
no setter
- timeoutInSeconds → int
-
The amount of time this connection will wait during connecting before giving up.
no setter
- timeZone → String
-
The timezone of this connection for date operations that don't specify a timezone.
no setter
- username → String?
-
Username for authenticating this connection.
no setter
- useSSL → bool
-
Whether or not this connection should connect securely.
no setter
Methods
-
addMessage(
ClientMessage message) → void - Adds a Client Message to the existing connection
-
cancelTransaction(
{String? reason}) → void -
Cancels a transaction on this context.
override
-
close(
) → Future - Closes a connection.
-
execute(
String fmtString, {Map< String, dynamic> ? substitutionValues, int? timeoutInSeconds}) → Future<int> -
Executes a query on this context.
inherited
-
mappedResultsQuery(
String fmtString, {Map< String, dynamic> ? substitutionValues, bool? allowReuse, int? timeoutInSeconds}) → Future<List< Map< >String, Map< >String, dynamic> > -
Executes a query on this connection and returns each row as a Map.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
open(
) → Future - Establishes a connection with a PostgreSQL database.
-
query(
String fmtString, {Map< String, dynamic> ? substitutionValues, bool? allowReuse, int? timeoutInSeconds, bool? useSimpleQueryProtocol}) → Future<PostgreSQLResult> -
Executes a query on this context.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
transaction(
Future queryBlock(PostgreSQLExecutionContext connection), {int? commitTimeoutInSeconds}) → Future - Executes a series of queries inside a transaction on this connection.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
withV3(
Endpoint endpoint, {ConnectionSettings? connectionSettings}) → PostgreSQLConnection - Returns a somewhat compatible version of PostgreSQLConnection that is backed by the new v3 implementation.