You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
im seeing an error i cant explain or find fixes on the internet. Can you help me here?
Im using this packages in my Cargo.toml:
mysql = "25.0.1"refinery = { version = "0.8.14", features = ["mysql"]}
The mysql initialization happens flawlessly:
let url = format!("mysql://my_usr:my_pass@localhost:3306/{}",
if cfg!(debug_assertions){"my_db_dev"} else {"my_db"});letOk(pool) = Pool::new(url.as_str())else{
...
std::process::exit(1);};letOk(mut db_connection) = pool.get_conn()else{
...
std::process::exit(1);};
But creating the migrations like this
refinery::embed_migrations!("./src/database_handler/migrations");// compiles without errors
migrations::runner().run(&mut db_connection).unwrap();// compile time error
Results in an error, that tells me, that the mysql::PooledConn is not implementing refinery::Migrate. Only mysql::conn::pool::PooledConn is implementing it. I poked around a bit but have not found a solution to my problem. Can you help me?
Full error message:
Full error message
error[E0277]: the trait bound `mysql::PooledConn: refinery::Migrate` is not satisfied
--> src/database_handler/mod.rs:68:34
|
68 | migrations::runner().run(&mut db_connection).unwrap();
| --- ^^^^^^^^^^^^^^^^^^ the trait `refinery::Migrate` is not implemented for `mysql::PooledConn`
| |
| required by a bound introduced by this call
|
= help: the following other types implement trait `refinery::Migrate`:
mysql::conn::Conn
mysql::conn::pool::PooledConn
refinery::config::Config
note: required by a bound in `refinery::Runner::run`
--> /home/jonas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/refinery-core-0.8.14/src/runner.rs:364:12
|
362 | pub fn run<C>(&self, connection: &mut C) -> Result<Report, Error>
| --- required by a bound in this associated function
363 | where
364 | C: Migrate,
| ^^^^^^^ required by this bound in `Runner::run`
The text was updated successfully, but these errors were encountered:
Hello,
im seeing an error i cant explain or find fixes on the internet. Can you help me here?
Im using this packages in my
Cargo.toml
:The mysql initialization happens flawlessly:
But creating the migrations like this
Results in an error, that tells me, that the
mysql::PooledConn
is not implementingrefinery::Migrate
. Onlymysql::conn::pool::PooledConn
is implementing it. I poked around a bit but have not found a solution to my problem. Can you help me?Full error message:
Full error message
The text was updated successfully, but these errors were encountered: