@@ -58,10 +58,10 @@ mod ssl_mode;
58
58
/// # Example
59
59
///
60
60
/// ```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};
63
63
///
64
- /// # async fn example() -> sqlx ::Result<()> {
64
+ /// # async fn example() -> sqlx_core ::Result<()> {
65
65
/// // URL connection string
66
66
/// let conn = PgConnection::connect("postgres://localhost/mydb").await?;
67
67
///
@@ -80,9 +80,10 @@ mod ssl_mode;
80
80
///
81
81
/// // Change the log verbosity level for queries.
82
82
/// // 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);
84
84
///
85
- /// let pool = PgPool::connect_with(&opts).await?;
85
+ /// let pool = PgPool::connect_with(opts).await?;
86
+ /// # Ok(())
86
87
/// # }
87
88
/// ```
88
89
#[ derive( Debug , Clone ) ]
@@ -141,7 +142,7 @@ impl PgConnectOptions {
141
142
/// # Example
142
143
///
143
144
/// ```rust
144
- /// # use sqlx_core::postgres ::PgConnectOptions;
145
+ /// # use sqlx_postgres ::PgConnectOptions;
145
146
/// let options = PgConnectOptions::new();
146
147
/// ```
147
148
pub fn new ( ) -> Self {
@@ -208,7 +209,7 @@ impl PgConnectOptions {
208
209
/// # Example
209
210
///
210
211
/// ```rust
211
- /// # use sqlx_core::postgres ::PgConnectOptions;
212
+ /// # use sqlx_postgres ::PgConnectOptions;
212
213
/// let options = PgConnectOptions::new()
213
214
/// .host("localhost");
214
215
/// ```
@@ -222,7 +223,7 @@ impl PgConnectOptions {
222
223
/// # Example
223
224
///
224
225
/// ```rust
225
- /// # use sqlx_core::postgres ::PgConnectOptions;
226
+ /// # use sqlx_postgres ::PgConnectOptions;
226
227
/// let options = PgConnectOptions::new()
227
228
/// .host("127.0.0.1");
228
229
/// assert_eq!(options.get_host(), "127.0.0.1");
@@ -238,7 +239,7 @@ impl PgConnectOptions {
238
239
/// # Example
239
240
///
240
241
/// ```rust
241
- /// # use sqlx_core::postgres ::PgConnectOptions;
242
+ /// # use sqlx_postgres ::PgConnectOptions;
242
243
/// let options = PgConnectOptions::new()
243
244
/// .port(5432);
244
245
/// ```
@@ -264,7 +265,7 @@ impl PgConnectOptions {
264
265
/// # Example
265
266
///
266
267
/// ```rust
267
- /// # use sqlx_core::postgres ::PgConnectOptions;
268
+ /// # use sqlx_postgres ::PgConnectOptions;
268
269
/// let options = PgConnectOptions::new()
269
270
/// .username("postgres");
270
271
/// ```
@@ -278,7 +279,7 @@ impl PgConnectOptions {
278
279
/// # Example
279
280
///
280
281
/// ```rust
281
- /// # use sqlx_core::postgres ::PgConnectOptions;
282
+ /// # use sqlx_postgres ::PgConnectOptions;
282
283
/// let options = PgConnectOptions::new()
283
284
/// .username("root")
284
285
/// .password("safe-and-secure");
@@ -293,7 +294,7 @@ impl PgConnectOptions {
293
294
/// # Example
294
295
///
295
296
/// ```rust
296
- /// # use sqlx_core::postgres ::PgConnectOptions;
297
+ /// # use sqlx_postgres ::PgConnectOptions;
297
298
/// let options = PgConnectOptions::new()
298
299
/// .database("postgres");
299
300
/// ```
@@ -307,7 +308,7 @@ impl PgConnectOptions {
307
308
/// # Example
308
309
///
309
310
/// ```rust
310
- /// # use sqlx_core::postgres ::PgConnectOptions;
311
+ /// # use sqlx_postgres ::PgConnectOptions;
311
312
/// let options = PgConnectOptions::new()
312
313
/// .database("postgres");
313
314
/// assert!(options.get_database().is_some());
@@ -327,7 +328,7 @@ impl PgConnectOptions {
327
328
/// # Example
328
329
///
329
330
/// ```rust
330
- /// # use sqlx_core::postgres ::{PgSslMode, PgConnectOptions};
331
+ /// # use sqlx_postgres ::{PgSslMode, PgConnectOptions};
331
332
/// let options = PgConnectOptions::new()
332
333
/// .ssl_mode(PgSslMode::Require);
333
334
/// ```
@@ -343,7 +344,7 @@ impl PgConnectOptions {
343
344
/// # Example
344
345
///
345
346
/// ```rust
346
- /// # use sqlx_core::postgres ::{PgSslMode, PgConnectOptions};
347
+ /// # use sqlx_postgres ::{PgSslMode, PgConnectOptions};
347
348
/// let options = PgConnectOptions::new()
348
349
/// // Providing a CA certificate with less than VerifyCa is pointless
349
350
/// .ssl_mode(PgSslMode::VerifyCa)
@@ -359,7 +360,7 @@ impl PgConnectOptions {
359
360
/// # Example
360
361
///
361
362
/// ```rust
362
- /// # use sqlx_core::postgres ::{PgSslMode, PgConnectOptions};
363
+ /// # use sqlx_postgres ::{PgSslMode, PgConnectOptions};
363
364
/// let options = PgConnectOptions::new()
364
365
/// // Providing a CA certificate with less than VerifyCa is pointless
365
366
/// .ssl_mode(PgSslMode::VerifyCa)
@@ -379,7 +380,7 @@ impl PgConnectOptions {
379
380
/// This is for illustration purposes only.
380
381
///
381
382
/// ```rust
382
- /// # use sqlx_core::postgres ::{PgSslMode, PgConnectOptions};
383
+ /// # use sqlx_postgres ::{PgSslMode, PgConnectOptions};
383
384
///
384
385
/// const CERT: &[u8] = b"\
385
386
/// -----BEGIN CERTIFICATE-----
@@ -401,7 +402,7 @@ impl PgConnectOptions {
401
402
/// # Example
402
403
///
403
404
/// ```rust
404
- /// # use sqlx_core::postgres ::{PgSslMode, PgConnectOptions};
405
+ /// # use sqlx_postgres ::{PgSslMode, PgConnectOptions};
405
406
/// let options = PgConnectOptions::new()
406
407
/// // Providing a CA certificate with less than VerifyCa is pointless
407
408
/// .ssl_mode(PgSslMode::VerifyCa)
@@ -421,7 +422,7 @@ impl PgConnectOptions {
421
422
/// This is for illustration purposes only.
422
423
///
423
424
/// ```rust
424
- /// # use sqlx_core::postgres ::{PgSslMode, PgConnectOptions};
425
+ /// # use sqlx_postgres ::{PgSslMode, PgConnectOptions};
425
426
///
426
427
/// const KEY: &[u8] = b"\
427
428
/// -----BEGIN PRIVATE KEY-----
@@ -443,7 +444,7 @@ impl PgConnectOptions {
443
444
/// # Example
444
445
///
445
446
/// ```rust
446
- /// # use sqlx_core::postgres ::{PgSslMode, PgConnectOptions};
447
+ /// # use sqlx_postgres ::{PgSslMode, PgConnectOptions};
447
448
/// let options = PgConnectOptions::new()
448
449
/// // Providing a CA certificate with less than VerifyCa is pointless
449
450
/// .ssl_mode(PgSslMode::VerifyCa)
@@ -470,7 +471,7 @@ impl PgConnectOptions {
470
471
/// # Example
471
472
///
472
473
/// ```rust
473
- /// # use sqlx_core::postgres ::PgConnectOptions;
474
+ /// # use sqlx_postgres ::PgConnectOptions;
474
475
/// let options = PgConnectOptions::new()
475
476
/// .application_name("my-app");
476
477
/// ```
@@ -517,7 +518,7 @@ impl PgConnectOptions {
517
518
///
518
519
/// ### Examples
519
520
/// ```rust
520
- /// # use sqlx_core::postgres ::PgConnectOptions;
521
+ /// # use sqlx_postgres ::PgConnectOptions;
521
522
///
522
523
/// let mut options = PgConnectOptions::new()
523
524
/// // for Redshift and Postgres 10
@@ -559,7 +560,7 @@ impl PgConnectOptions {
559
560
/// # Example
560
561
///
561
562
/// ```rust
562
- /// # use sqlx_core::postgres ::PgConnectOptions;
563
+ /// # use sqlx_postgres ::PgConnectOptions;
563
564
/// let options = PgConnectOptions::new()
564
565
/// .options([("geqo", "off"), ("statement_timeout", "5min")]);
565
566
/// ```
0 commit comments