@@ -17,7 +17,7 @@ Rust-Postgres is a pure-Rust frontend for the popular PostgreSQL database.
17
17
``` rust
18
18
extern crate postgres;
19
19
20
- use postgres :: {Connection , SslMode };
20
+ use postgres :: {Connection , TlsMode };
21
21
22
22
struct Person {
23
23
id : i32 ,
@@ -26,7 +26,7 @@ struct Person {
26
26
}
27
27
28
28
fn main () {
29
- let conn = Connection :: connect (" postgres://postgres@localhost" , SslMode :: None ). unwrap ();
29
+ let conn = Connection :: connect (" postgres://postgres@localhost" , TlsMode :: None ). unwrap ();
30
30
conn . execute (" CREATE TABLE person (
31
31
id SERIAL PRIMARY KEY,
32
32
name VARCHAR NOT NULL,
@@ -65,7 +65,7 @@ fn main() {
65
65
Connect to a Postgres server using the standard URI format:
66
66
``` rust
67
67
let conn = try ! (Connection :: connect (" postgres://user:pass@host:port/database?arg1=val1&arg2=val2" ,
68
- SslMode :: None ));
68
+ TlsMode :: None ));
69
69
```
70
70
` pass ` may be omitted if not needed. ` port ` defaults to ` 5432 ` and ` database `
71
71
defaults to the value of ` user ` if not specified. The driver supports ` trust ` ,
@@ -76,7 +76,7 @@ be set to the absolute path to the directory containing the socket file. Since
76
76
` / ` is a reserved character in URLs, the path should be URL encoded. If Postgres
77
77
stored its socket files in ` /run/postgres ` , the connection would then look like:
78
78
``` rust
79
- let conn = try ! (Connection :: connect (" postgres://postgres@%2Frun%2Fpostgres" , SslMode :: None ));
79
+ let conn = try ! (Connection :: connect (" postgres://postgres@%2Frun%2Fpostgres" , TlsMode :: None ));
80
80
```
81
81
Paths which contain non-UTF8 characters can be handled in a different manner;
82
82
see the documentation for details.
0 commit comments