MySqlDatabase class

A concrete implementation of DartApiDB for MySQL databases.

Uses the mysql_client_plus package to interact with the database and supports parameterized queries, inserts, updates, and deletions.

Implemented types

Constructors

MySqlDatabase.new(DbConfig config)
Creates a new MySqlDatabase using the given config.

Properties

config DbConfig
Configuration for connecting to the MySQL database.
final
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>
Closes the connection to the MySQL database.
override
connect() Future<void>
Opens the connection to the MySQL database.
override
delete(String table, {required Map<String, dynamic> where}) Future<DbResult>
Executes a DELETE query on the specified table.
override
insert(String table, Map<String, dynamic> data) Future<DbResult>
Executes an INSERT query into the specified table.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
rawQuery(String query, {Map<String, dynamic>? values}) Future<DbResult>
Executes a raw SQL query using named parameter substitution.
override
select(String table, {Map<String, dynamic>? where}) Future<DbResult>
Executes a SELECT query on the specified table.
override
toString() String
A string representation of this object.
inherited
update(String table, Map<String, dynamic> data, {required Map<String, dynamic> where}) Future<DbResult>
Executes an UPDATE query on the specified table.
override

Operators

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