discontinuedPackage webapp has been discontinued and replaced by finch.

MySQLConnection class

Main class to interact with MySQL database

Use MySQLConnection.createConnection to create connection

Properties

connected → bool
Returns true if this connection can be used to interact with database
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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]) → Future<IResultSet>
Executes given query
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'}) → Future<MySQLConnection>
Creates connection with provided options.