MySQLConnection class
Main class to interact with MySQL database
Use MySQLConnection.createConnection to create connection
Properties
Methods
-
close(
) → Future< void> - Close this connection gracefully
-
connect(
{int timeoutMs = 10000}) → Future< void> - Initiate connection to database. To close connection, invoke MySQLConnection.close method.
-
execute(
String query, [Map< String, dynamic> ? params, bool iterable = false, Duration? queryTimeout]) → Future<IResultSet> -
Executes given
query
-
getSocket(
) → Socket -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onClose(
void callback()) → void - Registers callack to be executed when this connection is closed
-
prepare(
String query, [bool iterable = false]) → Future< PreparedStmt> -
Prepares given
query
-
toString(
) → String -
A string representation of this object.
inherited
-
transactional<
T> (FutureOr< T> callback(MySQLConnection conn)) → Future<T> -
Execute
callback
inside database transaction
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
createConnection(
{required dynamic host, required int port, required String userName, required String password, bool secure = true, String? databaseName, String collation = 'utf8mb4_general_ci', SecurityContext? securityContext, bool onBadCertificate(X509Certificate certificate)?}) → Future< MySQLConnection> - Creates connection with provided options.