mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-30 15:15:01 +00:00
fix: error handling in main options examples
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user