diff --git a/Cargo.toml b/Cargo.toml index c0cb927e..91b9c2f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,14 +22,14 @@ postgres = [] mariadb = [] [dependencies] -async-std = { version = "1.1", features = ["attributes"] } -async-stream = "0.2" -async-trait = "0.1.11" -bitflags = "1.1.0" +async-std = { version = "1.1.0", features = ["attributes"] } +async-stream = "0.2.0" +async-trait = "0.1.18" +bitflags = "1.2.1" byteorder = { version = "1.3.2", default-features = false } bytes = "0.4.12" -crossbeam-queue = "0.1.2" -crossbeam-utils = { version = "0.6.6", default-features = false } +crossbeam-queue = "0.2.0" +crossbeam-utils = { version = "0.7.0", default-features = false } futures-channel = "0.3.1" futures-core = "0.3.1" futures-util = "0.3.1" @@ -42,7 +42,7 @@ uuid = { version = "0.8.1", optional = true } [dev-dependencies] matches = "0.1.8" sqlx-macros = { path = "sqlx-macros/", features = ["postgres", "mariadb", "uuid"] } -criterion = "0.3" +criterion = "0.3.0" [profile.release] lto = true diff --git a/examples/tide/Cargo.toml b/examples/tide/Cargo.toml index 0f159d49..e422925f 100644 --- a/examples/tide/Cargo.toml +++ b/examples/tide/Cargo.toml @@ -12,4 +12,4 @@ dotenv = "0.15.0" tide = "0.3.0" tokio = { version = "0.2.0-alpha.4", default-features = false, features = [ "rt-full" ] } sqlx = { path = "../..", features = [ "postgres" ] } -serde = { version = "1", features = [ "derive"] } \ No newline at end of file +serde = { version = "1", features = [ "derive"] } diff --git a/examples/tide/src/main.rs b/examples/tide/src/main.rs index de9211fb..d1afb082 100644 --- a/examples/tide/src/main.rs +++ b/examples/tide/src/main.rs @@ -1,9 +1,9 @@ use sqlx::{Pool, Postgres}; use std::env; use tide::error::ResultExt; +use tide::http::StatusCode; use tide::response; use tide::EndpointResult; -use tide::http::StatusCode; use tide::{App, Context}; // #[async_std::main] diff --git a/sqlx-macros/Cargo.toml b/sqlx-macros/Cargo.toml index 4148dc96..e37eb45a 100644 --- a/sqlx-macros/Cargo.toml +++ b/sqlx-macros/Cargo.toml @@ -8,13 +8,13 @@ edition = "2018" proc-macro = true [dependencies] -async-std = "1.0" +async-std = "1.1.0" dotenv = "0.15.0" futures = "0.3.1" proc-macro2 = "1.0.6" sqlx = { path = "../" } -syn = "1.0" -quote = "1.0" +syn = "1.0.8" +quote = "1.0.2" tokio = { version = "0.2.0-alpha.4" } url = "2.1.0" diff --git a/src/io/buf_stream.rs b/src/io/buf_stream.rs index c3882c29..908b93fa 100644 --- a/src/io/buf_stream.rs +++ b/src/io/buf_stream.rs @@ -1,10 +1,10 @@ use bytes::{BufMut, BytesMut}; use std::io; - -use async_std::io::prelude::*; +use async_std::io::{Read, Write, prelude::{ReadExt, WriteExt}}; +use async_std::future::poll_fn; pub struct BufStream { - stream: S, + pub(crate) stream: S, // Have we reached end-of-file (been disconnected) stream_eof: bool, @@ -29,12 +29,6 @@ where } } - pub async fn close(&mut self) -> io::Result<()> { - use futures_util::io::AsyncWriteExt; - - self.stream.close().await - } - #[inline] pub fn buffer_mut(&mut self) -> &mut Vec { &mut self.wbuf diff --git a/src/postgres/raw.rs b/src/postgres/raw.rs index c68c2c35..93d9b9c8 100644 --- a/src/postgres/raw.rs +++ b/src/postgres/raw.rs @@ -5,6 +5,7 @@ use crate::{ PostgresDatabaseError, PostgresQueryParameters, PostgresRow, }, }; +use std::net::Shutdown; use byteorder::NetworkEndian; use std::{io, net::SocketAddr}; use async_std::net::TcpStream; @@ -134,7 +135,7 @@ impl PostgresRawConnection { protocol::Terminate.encode(self.stream.buffer_mut()); self.stream.flush().await?; - self.stream.close().await?; + self.stream.stream.shutdown(Shutdown::Both)?; Ok(()) }