mirror of
https://github.com/actix/examples
synced 2024-11-23 14:31:07 +01:00
update mysql dependency to 23
This commit is contained in:
parent
7caab85d01
commit
3ffb06abb7
956
Cargo.lock
generated
956
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -63,3 +63,7 @@ members = [
|
||||
"websockets/echo",
|
||||
]
|
||||
resolver = "2"
|
||||
|
||||
[patch.crates-io.r2d2_mysql]
|
||||
git = "https://github.com/outersky/r2d2-mysql.git"
|
||||
rev = "v23.0.0"
|
||||
|
@ -10,9 +10,9 @@ actix-cors = "0.6"
|
||||
|
||||
juniper = "0.15"
|
||||
|
||||
mysql = "22"
|
||||
mysql = "23"
|
||||
r2d2 = "0.8"
|
||||
r2d2_mysql = "22"
|
||||
r2d2_mysql = "23"
|
||||
|
||||
dotenv = "0.15"
|
||||
env_logger = "0.9"
|
||||
|
@ -1,14 +1,14 @@
|
||||
use r2d2_mysql::{
|
||||
mysql::{Opts, OptsBuilder},
|
||||
MysqlConnectionManager,
|
||||
MySqlConnectionManager,
|
||||
};
|
||||
|
||||
pub type Pool = r2d2::Pool<MysqlConnectionManager>;
|
||||
pub type Pool = r2d2::Pool<MySqlConnectionManager>;
|
||||
|
||||
pub fn get_db_pool() -> Pool {
|
||||
let db_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set");
|
||||
let opts = Opts::from_url(&db_url).unwrap();
|
||||
let builder = OptsBuilder::from_opts(opts);
|
||||
let manager = MysqlConnectionManager::new(builder);
|
||||
let manager = MySqlConnectionManager::new(builder);
|
||||
r2d2::Pool::new(manager).expect("Failed to create DB Pool")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user