Skip to content

Commit 4266c79

Browse files
committed
Add type features to tokio
1 parent 32dc892 commit 4266c79

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

postgres-tokio/Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ version = "0.1.0"
44
authors = ["Steven Fackler <[email protected]>"]
55

66
[features]
7+
with-bit-vec = ["postgres-shared/with-bit-vec"]
8+
with-chrono = ["postgres-shared/with-chrono"]
9+
with-eui48 = ["postgres-shared/with-eui48"]
10+
with-rustc-serialize = ["postgres-shared/with-rustc-serialize"]
11+
with-serde_json = ["postgres-shared/with-serde_json"]
12+
with-time = ["postgres-shared/with-time"]
13+
with-uuid = ["postgres-shared/with-uuid"]
14+
715
with-openssl = ["tokio-openssl", "openssl"]
816

917
[dependencies]

postgres-tokio/src/test.rs

+12-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
use futures::{Future, Stream};
22
use futures_state_stream::StateStream;
33
use std::error::Error as StdError;
4+
use std::path::PathBuf;
45
use std::time::Duration;
56
use tokio_core::reactor::{Core, Interval};
67

78
use super::*;
89
use error::{Error, ConnectError, SqlState};
9-
use params::ConnectParams;
10+
use params::{ConnectParams, ConnectTarget, UserInfo};
1011
use types::{ToSql, FromSql, Type, SessionInfo, IsNull, Kind};
1112

1213
#[test]
@@ -190,9 +191,16 @@ fn unix_socket() {
190191
.and_then(|(s, c)| c.query(&s, &[]).collect())
191192
.then(|r| {
192193
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+
};
196204
Connection::connect(params, TlsMode::None, &handle)
197205
})
198206
.then(|c| c.unwrap().batch_execute(""));

0 commit comments

Comments
 (0)