Questions tagged [rust-diesel-mysql]

8 questions
2
votes
1 answer

Error installing Diesel CLI: cannot find -lmysqlclient

When I install Diesel CLI with the following command: $ cargo install diesel_cli --no-default-features --features mysql I get the following error message: error: linking with `cc` failed: exit status: 1 | = note: "cc"…
Bart Weber
  • 1,136
  • 4
  • 15
  • 32
1
vote
1 answer

Trait bound not satisfied in diesel rust

Hello i load the content of a table in a vec with diesel and mysql fn establish_connection() -> MysqlConnection { dotenv().ok(); let database_url = env::var("DATABASE_URL") .expect("DATABASE_URL must be set"); …
GranBoh
  • 67
  • 8
1
vote
1 answer

Rust how to implement diesel::Insertable
I'm trying to implement the trait diesel::Insertable
Cedric Martens
  • 1,139
  • 10
  • 23
1
vote
1 answer

Rust/Rocket/Diesel - How can I query a MySqlDatabase using rocket_sync_db_pools

When trying to call load on my prices schema created by diesel in a Rocket app, I get the error the trait LoadConnection is not implemented for &mut rocket_sync_db_pools::diesel::MysqlConnection I've looked at a few tutorials, and have followed the…
1
vote
2 answers

How to handle a failure to get a connection from the database pool?

I'm building an API using Rocket and Diesel, and I'm managing the DbPool using Rocket's State. A search request handler might look like this, then: #[get("/search?")] pub fn general_privileged( db_pool: &State, _key:…
tcmoore
  • 1,129
  • 1
  • 12
  • 29
0
votes
0 answers

Adding columns to my table I am getting Insertable trait Error , but those types are already use in table

Below is my table so I have added last three columns to my table , Upon adding , the last message is occurring so when I remove those columns/fields issue gone but i need more columns in my table. `diesel::table! { document_template_masters…
0
votes
1 answer

diesel.rs use select max with other arguments

i have implemented the mysql query in rust, but i select causes an error. This is the error the trait `diesel::expression::MixedAggregates` is not implemented for `diesel::expression::is_aggregate::No Whats the…
filif96770
  • 55
  • 5
0
votes
0 answers

diesel print-schema > src/schema.rs doesn't contain diesel::joinable! macro for foreign keys (Mysql)

I have created two tables in my Mysql db using following instructions: CREATE TABLE user ( UserID int NOT NULL, UserName varchar(100), CONSTRAINT PK_USER PRIMARY KEY (UserID) ); and CREATE TABLE app ( AppID int NOT NULL, AppName…
Rusty
  • 1,086
  • 2
  • 13
  • 27