mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
fix: error handling in main options examples
This commit is contained in:
parent
a3053119fa
commit
bb7c064bec
@ -75,7 +75,7 @@ impl FromStr for MySqlSslMode {
|
||||
/// # use sqlx_core::connection::Connect;
|
||||
/// # use sqlx_core::mysql::{MySqlConnectOptions, MySqlConnection, MySqlSslMode};
|
||||
/// #
|
||||
/// # fn main() {
|
||||
/// # fn main() -> Result<(), Error> {
|
||||
/// # #[cfg(feature = "runtime-async-std")]
|
||||
/// # sqlx_rt::async_std::task::block_on(async move {
|
||||
/// // URI connection string
|
||||
@ -88,7 +88,8 @@ impl FromStr for MySqlSslMode {
|
||||
/// .password("password")
|
||||
/// .database("db")
|
||||
/// ).await?;
|
||||
/// # }).unwrap();
|
||||
/// # Ok(())
|
||||
/// # })
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Debug, Clone)]
|
||||
|
||||
@ -88,7 +88,7 @@ impl FromStr for PgSslMode {
|
||||
/// # use sqlx_core::connection::Connect;
|
||||
/// # use sqlx_core::postgres::{PgConnectOptions, PgConnection, PgSslMode};
|
||||
/// #
|
||||
/// # fn main() {
|
||||
/// # fn main() -> Result<(), Error> {
|
||||
/// # #[cfg(feature = "runtime-async-std")]
|
||||
/// # sqlx_rt::async_std::task::block_on(async move {
|
||||
/// // URI connection string
|
||||
@ -102,7 +102,8 @@ impl FromStr for PgSslMode {
|
||||
/// .password("secret-password")
|
||||
/// .ssl_mode(PgSslMode::Require)
|
||||
/// ).await?;
|
||||
/// # }).unwrap();
|
||||
/// # Ok(())
|
||||
/// # })
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Debug, Clone)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user