Add type features to tokio

This commit is contained in:
Steven Fackler 2016-12-26 15:35:28 -05:00
parent 32dc8923d7
commit 4266c79dd8
2 changed files with 20 additions and 4 deletions

View File

@ -4,6 +4,14 @@ version = "0.1.0"
authors = ["Steven Fackler <sfackler@gmail.com>"]
[features]
with-bit-vec = ["postgres-shared/with-bit-vec"]
with-chrono = ["postgres-shared/with-chrono"]
with-eui48 = ["postgres-shared/with-eui48"]
with-rustc-serialize = ["postgres-shared/with-rustc-serialize"]
with-serde_json = ["postgres-shared/with-serde_json"]
with-time = ["postgres-shared/with-time"]
with-uuid = ["postgres-shared/with-uuid"]
with-openssl = ["tokio-openssl", "openssl"]
[dependencies]

View File

@ -1,12 +1,13 @@
use futures::{Future, Stream};
use futures_state_stream::StateStream;
use std::error::Error as StdError;
use std::path::PathBuf;
use std::time::Duration;
use tokio_core::reactor::{Core, Interval};
use super::*;
use error::{Error, ConnectError, SqlState};
use params::ConnectParams;
use params::{ConnectParams, ConnectTarget, UserInfo};
use types::{ToSql, FromSql, Type, SessionInfo, IsNull, Kind};
#[test]
@ -190,9 +191,16 @@ fn unix_socket() {
.and_then(|(s, c)| c.query(&s, &[]).collect())
.then(|r| {
let r = r.unwrap().0;
let params = ConnectParams::builder()
.user("postgres", None)
.build_unix(r[0].get::<String, _>(0));
let params = ConnectParams {
target: ConnectTarget::Unix(PathBuf::from(r[0].get::<String, _>(0))),
port: None,
user: Some(UserInfo {
user: "postgres".to_owned(),
password: None,
}),
database: None,
options: vec![],
};
Connection::connect(params, TlsMode::None, &handle)
})
.then(|c| c.unwrap().batch_execute(""));