Skip to content

Commit b4c1520

Browse files
committed
Add documentation for domain sockets to README
1 parent 306b976 commit b4c1520

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@ let conn = try!(PostgresConnection::connect("postgres://user:pass@host:port/data
8787
defaults to the value of `user` if not specified. The driver supports `trust`,
8888
`password`, and `md5` authentication.
8989

90+
Unix domain sockets can be used as well. The `host` portion of the URI should be
91+
set to the absolute path to the directory containing the socket file. Since `/`
92+
is a reserved character in URLs, the path should be URL encoded.
93+
```rust
94+
let conn = try!(PosgresConnection::connect("postgres://postgres@%2Frun%2Fpostgres", &NoSsl));
95+
```
96+
Paths which contain non-UTF8 characters can be handled in a different manner;
97+
see the documentation for details.
98+
9099
Statement Preparation
91100
---------------------
92101
Prepared statements can have parameters, represented as `$n` where `n` is an

0 commit comments

Comments
 (0)