Skip to content

Commit dd365d5

Browse files
committed
fix doctest
1 parent 840dfa2 commit dd365d5

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

sqlx-postgres/src/advisory_lock.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ impl PgAdvisoryLock {
9898
/// [hkdf]: https://datatracker.ietf.org/doc/html/rfc5869
9999
/// ### Example
100100
/// ```rust
101-
/// # extern crate sqlx_core as sqlx;
102-
/// use sqlx::postgres::{PgAdvisoryLock, PgAdvisoryLockKey};
101+
/// use sqlx_postgres::{PgAdvisoryLock, PgAdvisoryLockKey};
103102
///
104103
/// let lock = PgAdvisoryLock::new("my first Postgres advisory lock!");
105104
/// // Negative values are fine because of how Postgres treats advisory lock keys.

sqlx-postgres/src/listener.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl PgListener {
188188
/// # Example
189189
///
190190
/// ```rust,no_run
191-
/// # use sqlx_core::postgres::PgListener;
191+
/// # use sqlx_postgres::PgListener;
192192
/// # use sqlx_core::error::Error;
193193
/// #
194194
/// # #[cfg(feature = "_rt")]
@@ -219,7 +219,7 @@ impl PgListener {
219219
/// # Example
220220
///
221221
/// ```rust,no_run
222-
/// # use sqlx_core::postgres::PgListener;
222+
/// # use sqlx_postgres::PgListener;
223223
/// # use sqlx_core::error::Error;
224224
/// #
225225
/// # #[cfg(feature = "_rt")]

sqlx-postgres/src/options/mod.rs

+24-23
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ mod ssl_mode;
5858
/// # Example
5959
///
6060
/// ```rust,no_run
61-
/// use sqlx::{Connection, ConnectOptions};
62-
/// use sqlx::postgres::{PgConnectOptions, PgConnection, PgPool, PgSslMode};
61+
/// use sqlx_core::connection::{Connection, ConnectOptions};
62+
/// use sqlx_postgres::{PgConnectOptions, PgConnection, PgPool, PgSslMode};
6363
///
64-
/// # async fn example() -> sqlx::Result<()> {
64+
/// # async fn example() -> sqlx_core::Result<()> {
6565
/// // URL connection string
6666
/// let conn = PgConnection::connect("postgres://localhost/mydb").await?;
6767
///
@@ -80,9 +80,10 @@ mod ssl_mode;
8080
///
8181
/// // Change the log verbosity level for queries.
8282
/// // Information about SQL queries is logged at `DEBUG` level by default.
83-
/// opts.log_statements(log::LevelFilter::Trace);
83+
/// opts = opts.log_statements(log::LevelFilter::Trace);
8484
///
85-
/// let pool = PgPool::connect_with(&opts).await?;
85+
/// let pool = PgPool::connect_with(opts).await?;
86+
/// # Ok(())
8687
/// # }
8788
/// ```
8889
#[derive(Debug, Clone)]
@@ -141,7 +142,7 @@ impl PgConnectOptions {
141142
/// # Example
142143
///
143144
/// ```rust
144-
/// # use sqlx_core::postgres::PgConnectOptions;
145+
/// # use sqlx_postgres::PgConnectOptions;
145146
/// let options = PgConnectOptions::new();
146147
/// ```
147148
pub fn new() -> Self {
@@ -208,7 +209,7 @@ impl PgConnectOptions {
208209
/// # Example
209210
///
210211
/// ```rust
211-
/// # use sqlx_core::postgres::PgConnectOptions;
212+
/// # use sqlx_postgres::PgConnectOptions;
212213
/// let options = PgConnectOptions::new()
213214
/// .host("localhost");
214215
/// ```
@@ -222,7 +223,7 @@ impl PgConnectOptions {
222223
/// # Example
223224
///
224225
/// ```rust
225-
/// # use sqlx_core::postgres::PgConnectOptions;
226+
/// # use sqlx_postgres::PgConnectOptions;
226227
/// let options = PgConnectOptions::new()
227228
/// .host("127.0.0.1");
228229
/// assert_eq!(options.get_host(), "127.0.0.1");
@@ -238,7 +239,7 @@ impl PgConnectOptions {
238239
/// # Example
239240
///
240241
/// ```rust
241-
/// # use sqlx_core::postgres::PgConnectOptions;
242+
/// # use sqlx_postgres::PgConnectOptions;
242243
/// let options = PgConnectOptions::new()
243244
/// .port(5432);
244245
/// ```
@@ -264,7 +265,7 @@ impl PgConnectOptions {
264265
/// # Example
265266
///
266267
/// ```rust
267-
/// # use sqlx_core::postgres::PgConnectOptions;
268+
/// # use sqlx_postgres::PgConnectOptions;
268269
/// let options = PgConnectOptions::new()
269270
/// .username("postgres");
270271
/// ```
@@ -278,7 +279,7 @@ impl PgConnectOptions {
278279
/// # Example
279280
///
280281
/// ```rust
281-
/// # use sqlx_core::postgres::PgConnectOptions;
282+
/// # use sqlx_postgres::PgConnectOptions;
282283
/// let options = PgConnectOptions::new()
283284
/// .username("root")
284285
/// .password("safe-and-secure");
@@ -293,7 +294,7 @@ impl PgConnectOptions {
293294
/// # Example
294295
///
295296
/// ```rust
296-
/// # use sqlx_core::postgres::PgConnectOptions;
297+
/// # use sqlx_postgres::PgConnectOptions;
297298
/// let options = PgConnectOptions::new()
298299
/// .database("postgres");
299300
/// ```
@@ -307,7 +308,7 @@ impl PgConnectOptions {
307308
/// # Example
308309
///
309310
/// ```rust
310-
/// # use sqlx_core::postgres::PgConnectOptions;
311+
/// # use sqlx_postgres::PgConnectOptions;
311312
/// let options = PgConnectOptions::new()
312313
/// .database("postgres");
313314
/// assert!(options.get_database().is_some());
@@ -327,7 +328,7 @@ impl PgConnectOptions {
327328
/// # Example
328329
///
329330
/// ```rust
330-
/// # use sqlx_core::postgres::{PgSslMode, PgConnectOptions};
331+
/// # use sqlx_postgres::{PgSslMode, PgConnectOptions};
331332
/// let options = PgConnectOptions::new()
332333
/// .ssl_mode(PgSslMode::Require);
333334
/// ```
@@ -343,7 +344,7 @@ impl PgConnectOptions {
343344
/// # Example
344345
///
345346
/// ```rust
346-
/// # use sqlx_core::postgres::{PgSslMode, PgConnectOptions};
347+
/// # use sqlx_postgres::{PgSslMode, PgConnectOptions};
347348
/// let options = PgConnectOptions::new()
348349
/// // Providing a CA certificate with less than VerifyCa is pointless
349350
/// .ssl_mode(PgSslMode::VerifyCa)
@@ -359,7 +360,7 @@ impl PgConnectOptions {
359360
/// # Example
360361
///
361362
/// ```rust
362-
/// # use sqlx_core::postgres::{PgSslMode, PgConnectOptions};
363+
/// # use sqlx_postgres::{PgSslMode, PgConnectOptions};
363364
/// let options = PgConnectOptions::new()
364365
/// // Providing a CA certificate with less than VerifyCa is pointless
365366
/// .ssl_mode(PgSslMode::VerifyCa)
@@ -379,7 +380,7 @@ impl PgConnectOptions {
379380
/// This is for illustration purposes only.
380381
///
381382
/// ```rust
382-
/// # use sqlx_core::postgres::{PgSslMode, PgConnectOptions};
383+
/// # use sqlx_postgres::{PgSslMode, PgConnectOptions};
383384
///
384385
/// const CERT: &[u8] = b"\
385386
/// -----BEGIN CERTIFICATE-----
@@ -401,7 +402,7 @@ impl PgConnectOptions {
401402
/// # Example
402403
///
403404
/// ```rust
404-
/// # use sqlx_core::postgres::{PgSslMode, PgConnectOptions};
405+
/// # use sqlx_postgres::{PgSslMode, PgConnectOptions};
405406
/// let options = PgConnectOptions::new()
406407
/// // Providing a CA certificate with less than VerifyCa is pointless
407408
/// .ssl_mode(PgSslMode::VerifyCa)
@@ -421,7 +422,7 @@ impl PgConnectOptions {
421422
/// This is for illustration purposes only.
422423
///
423424
/// ```rust
424-
/// # use sqlx_core::postgres::{PgSslMode, PgConnectOptions};
425+
/// # use sqlx_postgres::{PgSslMode, PgConnectOptions};
425426
///
426427
/// const KEY: &[u8] = b"\
427428
/// -----BEGIN PRIVATE KEY-----
@@ -443,7 +444,7 @@ impl PgConnectOptions {
443444
/// # Example
444445
///
445446
/// ```rust
446-
/// # use sqlx_core::postgres::{PgSslMode, PgConnectOptions};
447+
/// # use sqlx_postgres::{PgSslMode, PgConnectOptions};
447448
/// let options = PgConnectOptions::new()
448449
/// // Providing a CA certificate with less than VerifyCa is pointless
449450
/// .ssl_mode(PgSslMode::VerifyCa)
@@ -470,7 +471,7 @@ impl PgConnectOptions {
470471
/// # Example
471472
///
472473
/// ```rust
473-
/// # use sqlx_core::postgres::PgConnectOptions;
474+
/// # use sqlx_postgres::PgConnectOptions;
474475
/// let options = PgConnectOptions::new()
475476
/// .application_name("my-app");
476477
/// ```
@@ -517,7 +518,7 @@ impl PgConnectOptions {
517518
///
518519
/// ### Examples
519520
/// ```rust
520-
/// # use sqlx_core::postgres::PgConnectOptions;
521+
/// # use sqlx_postgres::PgConnectOptions;
521522
///
522523
/// let mut options = PgConnectOptions::new()
523524
/// // for Redshift and Postgres 10
@@ -559,7 +560,7 @@ impl PgConnectOptions {
559560
/// # Example
560561
///
561562
/// ```rust
562-
/// # use sqlx_core::postgres::PgConnectOptions;
563+
/// # use sqlx_postgres::PgConnectOptions;
563564
/// let options = PgConnectOptions::new()
564565
/// .options([("geqo", "off"), ("statement_timeout", "5min")]);
565566
/// ```

0 commit comments

Comments
 (0)