Skip to content

Commit 9d2c521

Browse files
authored
Update README to clarify MariaDB support (#3001)
1 parent fd53e95 commit 9d2c521

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ SQLx is an async, pure Rust<sub>†</sub> SQL crate featuring compile-time check
6363

6464
- **Compile-time checked queries** (if you want). See [SQLx is not an ORM](#sqlx-is-not-an-orm).
6565

66-
- **Database Agnostic**. Support for [PostgreSQL], [MySQL], [SQLite].
66+
- **Database Agnostic**. Support for [PostgreSQL], [MySQL], [MariaDB], [SQLite].
6767
- [MSSQL] was supported prior to version 0.7, but has been removed pending a full rewrite of the driver as part of our [SQLx Pro initiative].
6868

6969
- **Pure Rust**. The Postgres and MySQL/MariaDB drivers are written in pure Rust using **zero** unsafe<sub>††</sub> code.
@@ -83,6 +83,7 @@ The SQLite driver directly invokes the SQLite3 API via `libsqlite3-sys`, which r
8383
[postgresql]: http://postgresql.org/
8484
[sqlite]: https://sqlite.org/
8585
[mysql]: https://www.mysql.com/
86+
[mariadb]: https://www.mariadb.org/
8687
[mssql]: https://www.microsoft.com/en-us/sql-server
8788
[SQLx Pro initiative]: https://github.com/launchbadge/sqlx/discussions/1616
8889

@@ -100,7 +101,7 @@ The SQLite driver directly invokes the SQLite3 API via `libsqlite3-sys`, which r
100101
- Simple (unprepared) query execution including fetching results into the same `Row` types used by
101102
the high-level API. Supports batch execution and returns results from all statements.
102103

103-
- Transport Layer Security (TLS) where supported ([MySQL] and [PostgreSQL]).
104+
- Transport Layer Security (TLS) where supported ([MySQL], [MariaDB] and [PostgreSQL]).
104105

105106
- Asynchronous notifications using `LISTEN` and `NOTIFY` for [PostgreSQL].
106107

@@ -232,14 +233,14 @@ use sqlx::postgres::PgPoolOptions;
232233
// or #[actix_web::main]
233234
async fn main() -> Result<(), sqlx::Error> {
234235
// Create a connection pool
235-
// for MySQL, use MySqlPoolOptions::new()
236+
// for MySQL/MariaDB, use MySqlPoolOptions::new()
236237
// for SQLite, use SqlitePoolOptions::new()
237238
// etc.
238239
let pool = PgPoolOptions::new()
239240
.max_connections(5)
240241
.connect("postgres://postgres:password@localhost/test").await?;
241242

242-
// Make a simple query to return the given parameter (use a question mark `?` instead of `$1` for MySQL)
243+
// Make a simple query to return the given parameter (use a question mark `?` instead of `$1` for MySQL/MariaDB)
243244
let row: (i64,) = sqlx::query_as("SELECT $1")
244245
.bind(150_i64)
245246
.fetch_one(&pool).await?;

0 commit comments

Comments
 (0)