Creating Diesel.rs queries with a dynamic number of .and()’s

The first thing you need to do is look at the complete error message: error[E0308]: mismatched types –> src/main.rs:23:13 | 23 | inner = inner.and(author.like(format!(“%{}%”, authors[2])));//<2> | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `diesel::expression::operators::Like`, found struct `diesel::expression::operators::And` | = note: expected type `diesel::expression::operators::And<diesel::expression::operators::Like<_, _>, _>` found type `diesel::expression::operators::And<diesel::expression::operators::And<diesel::expression::operators::Like<_, _>, diesel::expression::operators::Like<schema::ebook::columns::author, diesel::expression::bound::Bound<diesel::sql_types::Text, std::string::String>>>, _>` It’s long, but that’s because … Read more

PostgreSQL authentication method 10 not supported

You have to upgrade the PostgreSQL client software (in this case, the libpq used by the Rust driver) to a later version that supports the scram-sha-256 authentication method introduced in PostgreSQL v10. Downgrading password_encryption in PostgreSQL to md5, changing all the passwords and using the md5 authentication method is a possible, but bad alternative. It … Read more