ConnectionOptions class

Options for connection establishment and statement execution.

Used when calling connect to configure timeouts. loginTimeout is passed to the ODBC driver as the login/connection timeout. maxResultBufferBytes caps the size of query result buffers for this connection (default defaultMaxResultBufferBytes when null).

Constructors

ConnectionOptions({Duration? connectionTimeout, Duration? loginTimeout, Duration? queryTimeout, int? maxResultBufferBytes, int? initialResultBufferBytes, bool autoReconnectOnConnectionLost = false, int? maxReconnectAttempts, Duration? reconnectBackoff})
const

Properties

autoReconnectOnConnectionLost bool
When true, the repository may attempt to reconnect and re-execute the operation on connection-lost errors. Default is false.
final
connectionTimeout Duration?
Timeout for establishing the connection. When set, used as loginTimeout for the ODBC driver if loginTimeout is null.
final
effectiveMaxReconnectAttempts int
Effective max reconnect attempts when ConnectionOptions.autoReconnectOnConnectionLost is true.
no setter
effectiveReconnectBackoff Duration
Effective delay between reconnect attempts.
no setter
hashCode int
The hash code for this object.
no setterinherited
initialResultBufferBytes int?
Initial size in bytes for query result buffer allocation. When null, defaultInitialResultBufferBytes is used. Larger values can reduce reallocation rounds for large result sets.
final
loginTimeout Duration?
Login timeout (ODBC SQL_ATTR_LOGIN_TIMEOUT). Takes precedence over connectionTimeout when both are set.
final
loginTimeoutMs int
Effective login timeout in milliseconds: loginTimeout ?? connectionTimeout, or 0 if neither is set.
no setter
maxReconnectAttempts int?
Maximum number of reconnect attempts when ConnectionOptions.autoReconnectOnConnectionLost is true. When null, defaultMaxReconnectAttempts is used.
final
maxResultBufferBytes int?
Maximum size in bytes for query result buffers on this connection. When null, defaultMaxResultBufferBytes is used.
final
queryTimeout Duration?
Timeout for individual queries. Applied when using prepared statements with a timeout (e.g. prepare with timeoutMs).
final
reconnectBackoff Duration?
Delay between reconnect attempts. When null, defaultReconnectBackoff is used.
final
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
toString() String
A string representation of this object.
inherited
validate() String?
Returns a human-readable validation message when options are invalid.

Operators

operator ==(Object other) bool
The equality operator.
inherited