MySQLConnection class

Concrete implementation of DatabaseConnection for MySQL using mysql1 package.

Implemented types

Constructors

MySQLConnection(Map<String, dynamic> _config)

Properties

hashCode int
The hash code for this object.
no setterinherited
isConnected bool
Checks if the connection is currently active and usable.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

beginTransaction() Future<void>
Start a new database transaction.
override
commit() Future<void>
Commit the active database transaction.
override
connect() Future<void>
Establishes a connection to the database.
override
disconnect() Future<void>
Terminates the current database connection.
override
execute(String sql, [List bindings = const []]) Future<DatabaseResponse>
Executes a raw SQL query with optional parameter bindings.
override
getSchemaBuilder() SchemaBuilder
Returns a schema builder for creating and modifying database structure.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
ping() Future<bool>
Performs a ping to check if the database connection is alive.
override
queryBuilder<T>(String table, {T modelFactory(Map<String, dynamic>)?}) QueryBuilderInterface<T>
Returns a query builder for the specified table.
override
rollBack() Future<void>
Rollback the active database transaction.
override
toString() String
A string representation of this object.
inherited
transaction<T>(Future<T> callback(), {Duration retryDelay = const Duration(milliseconds: 100), Future<void> onSuccess(T result)?, Future<void> onFailure(dynamic error)?, Future<void> onFinally()?, String? isolationLevel}) Future<T>
Executes a transactional block with retry, success/failure hooks.
override
unprepared(String sql) Future<void>
Execute a raw SQL statement without parameter binding.
override

Operators

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