Skip to content

Commit

Permalink
update mysql dependency to 24
Browse files Browse the repository at this point in the history
  • Loading branch information
robjtede committed Jul 8, 2023
1 parent 5827ac3 commit 374769a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 29 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,13 @@ jobs:
name: tests / ${{ matrix.version }}
runs-on: ubuntu-latest

env:
CI: 1
CARGO_UNSTABLE_SPARSE_REGISTRY: true

steps:
- uses: actions/checkout@v3

- name: Install Rust
run: |
rustup install ${{ matrix.version }} --no-self-update --profile minimal --force
rustup override set ${{ matrix.version }}
- run: cargo generate-lockfile
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2.2.0
uses: actions-rust-lang/setup-rust-toolchain@v1.5.0
with:
toolchain: ${{ matrix.version }}

- name: Setup MySQL
uses: mirromutth/mysql-action@v1.1
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

## Unreleased

## 24.0.0

- Update `mysql` dependency to `24`.
- Remove deprecated `MysqlConnectionManager` type alias.

## 23.0.0

- Update `mysql` dependency to `23`.
- Rename `MysqlConnectionManager` to `MySqlConnectionManager`. The old name remains available under a deprecated type alias.
- Hide `pool` module.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "r2d2_mysql"
version = "23.0.0"
version = "24.0.0"
authors = ["outersky <outersky@gmail.com>"]
license = "MIT"
description = "MySQL support for the r2d2 connection pool"
Expand All @@ -10,4 +10,4 @@ edition = "2018"

[dependencies]
r2d2 = "0.8.9"
mysql = "23"
mysql = "24"
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
# r2d2-mysql
# r2d2_mysql

> [`mysql`](https://github.com/blackbeam/rust-mysql-simple) support library for the [`r2d2`](https://github.com/sfackler/r2d2) connection pool.
[![crates.io](https://img.shields.io/crates/v/r2d2-mysql?label=latest)](https://crates.io/crates/r2d2-mysql)
[![Documentation](https://docs.rs/r2d2-mysql/badge.svg?version=23)](https://docs.rs/r2d2-mysql/23)
[![crates.io](https://img.shields.io/crates/v/r2d2_mysql?label=latest)](https://crates.io/crates/r2d2_mysql)
[![Documentation](https://docs.rs/r2d2_mysql/badge.svg?version=24)](https://docs.rs/r2d2_mysql/24)
![Version](https://img.shields.io/badge/rustc-1.59+-ab6000.svg)
![License](https://img.shields.io/crates/l/r2d2-mysql.svg)
[![Download](https://img.shields.io/crates/d/r2d2-mysql.svg)](https://crates.io/crates/r2d2-mysql)
![License](https://img.shields.io/crates/l/r2d2_mysql.svg)
[![Download](https://img.shields.io/crates/d/r2d2_mysql.svg)](https://crates.io/crates/r2d2_mysql)

## Install

Include `r2d2_mysql` in the `[dependencies]` section of your `Cargo.toml`:

```toml
[dependencies]
r2d2_mysql = "23"
r2d2_mysql = "24"
```

## Usage

```rust
use std::{env, sync::Arc, thread};
use mysql::{prelude::*, Opts, OptsBuilder};
use r2d2_mysql::MySqlConnectionManager;

use r2d2_mysql::{
mysql::{prelude::*, Opts, OptsBuilder},
r2d2, MySqlConnectionManager,
};

fn main() {
let url = env::var("DATABASE_URL").unwrap();
Expand Down
9 changes: 5 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
//! # Examples
//! ```
//! use std::{env, sync::Arc, thread};
//! use mysql::{prelude::*, Opts, OptsBuilder};
//! use r2d2_mysql::MySqlConnectionManager;
//!
//! use r2d2_mysql::{
//! mysql::{prelude::*, Opts, OptsBuilder},
//! r2d2, MySqlConnectionManager,
//! };
//!
//! let url = env::var("DATABASE_URL").unwrap();
//! let opts = Opts::from_url(&url).unwrap();
Expand Down Expand Up @@ -38,8 +41,6 @@ pub use r2d2;

mod pool;
pub use self::pool::MySqlConnectionManager;
#[allow(deprecated)]
pub use self::pool::MysqlConnectionManager;

#[cfg(test)]
mod test {
Expand Down
4 changes: 0 additions & 4 deletions src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@

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

#[doc(hidden)]
#[deprecated(since = "23.0.0", note = "Renamed to `MySqlConnectionManager`.")]
pub type MysqlConnectionManager = MySqlConnectionManager;

/// An [`r2d2`] connection manager for [`mysql`] connections.
#[derive(Clone, Debug)]
pub struct MySqlConnectionManager {
Expand Down

0 comments on commit 374769a

Please sign in to comment.