ConnectionSettings class

ConnectionSettings contains information to connect to MySQL database.

var s = ConnectionSettings(
  user: "root",
  password: "dart_jaguar",
  host: "localhost",
  port: 3306,
  db: "example",
  useSSL: true,
);

// Establish connection
final conn = await MySqlConnection.connect(s);

Constructors

ConnectionSettings({String? host = 'localhost', int? port = 3306, String? user, String? password, String? db, bool? useCompression = false, bool? useSSL = false, int? maxPacketSize = 16 * 1024 * 1024, Duration timeout = const Duration(seconds: 30), int? characterSet = CharacterSet.UTF8MB4})
ConnectionSettings.copy(ConnectionSettings o)

Properties

characterSet int?
Sets charset for communication with MySQL server.
getter/setter pair
db String?
Database name to connect to.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
host String?
Host of the MySQL server to connect to.
getter/setter pair
maxPacketSize int?
Sets the maximum packet size of each communication with MySQL server.
getter/setter pair
password String?
Password of the MySQL server to connect to.
getter/setter pair
port int?
Port of the MySQL server to connect to.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration
The timeout for connecting to the database and for all database operations.
getter/setter pair
useCompression bool?
Should compression be enabled for communication with the MySQL server?
getter/setter pair
user String?
User of the MySQL server to connect to.
getter/setter pair
useSSL bool?
Should communication with MySQL be secure?
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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