lref-provider-mysql
MySQL database provider for Rust Entity Framework (lref).
Implements DatabaseProvider, SqlGenerator, and AsyncConnection traits for MySQL using sqlx with async connection pooling.
Features
- Connection pooling via
sqlx::MySqlPool - MySQL-native parameterized queries (
?) - Backtick identifier quoting (
`table_name`) AUTO_INCREMENTcolumn type- Full CRUD:
execute(),query(), transactions (START TRANSACTION/COMMIT/ROLLBACK) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4table creation
Quick Start
[]
= "0.1"
= "0.1"
= { = "1", = ["full"] }
use DatabaseProvider;
use MySqlProvider;
use Arc;
let provider = new;
// Get a connection
let mut conn = provider.get_connection.await?;
// Execute parameterized query
conn.execute.await?;
// Query rows
let rows = conn.query.await?;
SQL Dialect
- Placeholders:
?(anonymous) - Identifiers:
`table_name`(backtick) - Pagination:
LIMIT t OFFSET s - Auto-increment:
AUTO_INCREMENT - Table creation:
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
License
MIT - ?see LICENSE