Skip to content

Commit

Permalink
update mysql dependency to 25
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Jun 5, 2024
1 parent d417726 commit 70d7159
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Unreleased

- Minimum supported Rust version (MSRV) is now 1.68 due to transitive `time` dependency.
- Update `mysql` dependency to `25`.
- Minimum supported Rust version (MSRV) is now 1.70 to align with `mysql` dependency.

## 24.0.0

Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "r2d2_mysql"
version = "24.0.0"
version = "25.0.0"
authors = ["outersky <[email protected]>"]
license = "MIT"
description = "MySQL support for the r2d2 connection pool"
repository = "https://github.com/outersky/r2d2-mysql.git"
repository = "https://github.com/outersky/r2d2-mysql"
keywords = ["mysql", "sql", "pool", "database", "r2d2"]
edition = "2021"
rust-version = "1.68"
rust-version = "1.70"

[dependencies]
r2d2 = "0.8.9"
mysql = "24"
mysql = "25"
13 changes: 3 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@
//! let pool = pool.clone();
//! let th = thread::spawn(move || {
//! let mut conn = pool.get().expect("error getting connection from pool");
//!
//! let _ = conn
//! .query("SELECT version()")
//! .map(|rows: Vec<String>| rows.is_empty())
//! .expect("error executing query");
//! conn.ping().expect("error executing query");
//! });
//!
//! tasks.push(th);
Expand All @@ -46,7 +42,7 @@ pub use self::pool::MySqlConnectionManager;
mod test {
use std::{env, sync::Arc, thread};

use mysql::{prelude::*, Opts, OptsBuilder};
use mysql::{Opts, OptsBuilder};

use super::MySqlConnectionManager;

Expand All @@ -65,10 +61,7 @@ mod test {
let th = thread::spawn(move || {
let mut conn = pool.get().expect("error getting connection from pool");

let _ = conn
.query("SELECT version()")
.map(|rows: Vec<String>| rows.is_empty())
.expect("error executing query");
conn.ping().expect("error executing query");
});

tasks.push(th);
Expand Down
4 changes: 2 additions & 2 deletions src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//!
//! See [`MySqlConnectionManager`].

use mysql::{error::Error, prelude::*, Conn, Opts, OptsBuilder};
use mysql::{error::Error, Conn, Opts, OptsBuilder};

/// An [`r2d2`] connection manager for [`mysql`] connections.
#[derive(Clone, Debug)]
Expand All @@ -28,7 +28,7 @@ impl r2d2::ManageConnection for MySqlConnectionManager {
}

fn is_valid(&self, conn: &mut Conn) -> Result<(), Error> {
conn.query("SELECT version()").map(|_: Vec<String>| ())
conn.ping()
}

fn has_broken(&self, conn: &mut Conn) -> bool {
Expand Down

0 comments on commit 70d7159

Please sign in to comment.