@@ -17,7 +17,7 @@ Rust-Postgres is a pure-Rust frontend for the popular PostgreSQL database.
1717``` rust
1818extern crate postgres;
1919
20- use postgres :: {Connection , SslMode };
20+ use postgres :: {Connection , TlsMode };
2121
2222struct Person {
2323 id : i32 ,
@@ -26,7 +26,7 @@ struct Person {
2626}
2727
2828fn main () {
29- let conn = Connection :: connect (" postgres://postgres@localhost" , SslMode :: None ). unwrap ();
29+ let conn = Connection :: connect (" postgres://postgres@localhost" , TlsMode :: None ). unwrap ();
3030 conn . execute (" CREATE TABLE person (
3131 id SERIAL PRIMARY KEY,
3232 name VARCHAR NOT NULL,
@@ -65,7 +65,7 @@ fn main() {
6565Connect to a Postgres server using the standard URI format:
6666``` rust
6767let conn = try ! (Connection :: connect (" postgres://user:pass@host:port/database?arg1=val1&arg2=val2" ,
68- SslMode :: None ));
68+ TlsMode :: None ));
6969```
7070` pass ` may be omitted if not needed. ` port ` defaults to ` 5432 ` and ` database `
7171defaults 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
7676` / ` is a reserved character in URLs, the path should be URL encoded. If Postgres
7777stored its socket files in ` /run/postgres ` , the connection would then look like:
7878``` 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 ));
8080```
8181Paths which contain non-UTF8 characters can be handled in a different manner;
8282see the documentation for details.
0 commit comments