Rust connection url example is incorrect #278
Answered
by
fooforge
oscartbeaumont
asked this question in
Bug Reports
-
When getting the connection URL from Planetscale it shows snippets from a bunch of different programming languages to help get you started. The Rust examples shows putting the connection URL in a Fix by changing use std::env;
use dotenv::dotenv;
fn main() {
dotenv.ok();
let url = env::var("DATABASE_URL").expect("DATABASE_URL not found");
let builder = mysql::OptsBuilder::from_opts(mysql::Opts::from_url(&url).unwrap());
let pool = mysql::Pool::new(builder.ssl_opts(mysql::SslOpts::default())).unwrap();
let _conn = pool.get_conn().unwrap();
println!("Successfully connected to PlanetScale!");
} |
Beta Was this translation helpful? Give feedback.
Answered by
fooforge
Sep 12, 2022
Replies: 1 comment 2 replies
-
Hey @oscartbeaumont, Thanks for letting us know! I will fix this up shortly. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
oscartbeaumont
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @oscartbeaumont,
Thanks for letting us know! I will fix this up shortly.