Add type features to tokio
This commit is contained in:
parent
32dc8923d7
commit
4266c79dd8
@ -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]
|
||||
|
@ -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(""));
|
||||
|
Loading…
Reference in New Issue
Block a user