|
1 | 1 | use futures::{Future, Stream};
|
2 | 2 | use futures_state_stream::StateStream;
|
3 | 3 | use std::error::Error as StdError;
|
| 4 | +use std::path::PathBuf; |
4 | 5 | use std::time::Duration;
|
5 | 6 | use tokio_core::reactor::{Core, Interval};
|
6 | 7 |
|
7 | 8 | use super::*;
|
8 | 9 | use error::{Error, ConnectError, SqlState};
|
9 |
| -use params::ConnectParams; |
| 10 | +use params::{ConnectParams, ConnectTarget, UserInfo}; |
10 | 11 | use types::{ToSql, FromSql, Type, SessionInfo, IsNull, Kind};
|
11 | 12 |
|
12 | 13 | #[test]
|
@@ -190,9 +191,16 @@ fn unix_socket() {
|
190 | 191 | .and_then(|(s, c)| c.query(&s, &[]).collect())
|
191 | 192 | .then(|r| {
|
192 | 193 | let r = r.unwrap().0;
|
193 |
| - let params = ConnectParams::builder() |
194 |
| - .user("postgres", None) |
195 |
| - .build_unix(r[0].get::<String, _>(0)); |
| 194 | + let params = ConnectParams { |
| 195 | + target: ConnectTarget::Unix(PathBuf::from(r[0].get::<String, _>(0))), |
| 196 | + port: None, |
| 197 | + user: Some(UserInfo { |
| 198 | + user: "postgres".to_owned(), |
| 199 | + password: None, |
| 200 | + }), |
| 201 | + database: None, |
| 202 | + options: vec![], |
| 203 | + }; |
196 | 204 | Connection::connect(params, TlsMode::None, &handle)
|
197 | 205 | })
|
198 | 206 | .then(|c| c.unwrap().batch_execute(""));
|
|
0 commit comments