MySqlConfig class

Configuration options for connecting to a MySQL database.

Constructors

MySqlConfig({required String host, required String user, required String pass, String dbName = '', int port = 3306, int poolMin = 1, int poolMax = 10, List<String> init = const [], List<String> setup = const [], int? tcpKeepalive, bool? tcpNodelay = true, int? connTtl, int? absConnTtl, int? absConnTtlJitter, int? stmtCacheSize, bool? requireSsl, bool? verifyCa, bool? verifyIdentity, bool? preferSocket, String? socket, String? compression, int? maxAllowedPacket, int? waitTimeout, bool? secureAuth, bool? clientFoundRows, bool? enableCleartextPlugin})
Creates a new MySqlConfig with the given settings.
const

Properties

absConnTtl int?
The absolute maximum lifetime for a connection in seconds.
final
absConnTtlJitter int?
Jitter applied to the absolute connection TTL.
final
clientFoundRows bool?
Whether to return the number of found rows instead of affected rows.
final
compression String?
The compression algorithm to use.
final
connTtl int?
The maximum idle time for a connection in seconds.
final
dbName String
The name of the database to connect to.
final
enableCleartextPlugin bool?
Whether to enable the cleartext authentication plugin.
final
hashCode int
The hash code for this object.
no setterinherited
host String
The hostname or IP address of the database server.
final
init List<String>
A list of queries to execute when a connection is initialized.
final
maxAllowedPacket int?
The maximum allowed packet size in bytes.
final
pass String
The password for authentication.
final
poolMax int
The maximum number of connections in the pool.
final
poolMin int
The minimum number of connections in the pool.
final
port int
The port number of the database server.
final
preferSocket bool?
Whether to prefer a Unix domain socket connection.
final
requireSsl bool?
Whether SSL is required for the connection.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
secureAuth bool?
Whether to use secure authentication.
final
setup List<String>
A list of queries to execute when the pool is setup.
final
socket String?
The path to the Unix domain socket.
final
stmtCacheSize int?
The size of the prepared statement cache.
final
tcpKeepalive int?
The TCP keepalive interval in seconds.
final
tcpNodelay bool?
Whether to disable Nagle's algorithm (TCP_NODELAY).
final
user String
The username for authentication.
final
verifyCa bool?
Whether to verify the server's Certificate Authority.
final
verifyIdentity bool?
Whether to verify the server's identity.
final
waitTimeout int?
The wait timeout for the connection in seconds.
final

Methods

copyWith({String? host, String? user, String? pass, String? dbName, int? port, int? poolMin, int? poolMax, List<String>? init, List<String>? setup, int? tcpKeepalive, bool? tcpNodelay, int? connTtl, int? absConnTtl, int? absConnTtlJitter, int? stmtCacheSize, bool? requireSsl, bool? verifyCa, bool? verifyIdentity, bool? preferSocket, String? socket, String? compression, int? maxAllowedPacket, int? waitTimeout, bool? secureAuth, bool? clientFoundRows, bool? enableCleartextPlugin}) MySqlConfig
Creates a copy of this configuration, replacing specified fields with new values.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toConnectionString() String
Converts this configuration into a MySQL connection string URI.
toString() String
A string representation of this object.
inherited

Operators

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