Expand description
MySQL connection implementation.
This module implements the MySQL wire protocol connection, including connection establishment, authentication, and state management.
§Current Status
Synchronous implementation complete. The async Connection trait from
sqlmodel_core is not yet implemented. Current API uses _sync suffix methods.
§Migration Path to Async
To implement the Connection trait, these changes are needed:
- Replace
std::net::TcpStreamwithasupersync::net::TcpStream - Convert
read_packet/write_packetto async with.await - Add
&Cxcontext parameter to all async methods - Return
Outcome<T, E>instead ofResult<T, E> - Add cancellation checks via
cx.checkpoint()?
See crates/sqlmodel-mysql/README.md for the full roadmap.
§Synchronous API
ⓘ
let mut conn = MySqlConnection::connect(config)?;
let rows = conn.query_sync("SELECT * FROM users WHERE id = ?", &[Value::Int(1)])?;
conn.close()?;Structs§
- MySql
Connection - MySQL connection.
- Server
Capabilities - Server capabilities received during handshake.
Enums§
- Connection
State - Connection state in the MySQL protocol state machine.