Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update postgres and tokio-postgres #138

Merged
merged 5 commits into from
Oct 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions refinery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ refinery-core= { version = "0.4.0", path = "../refinery_core" }
refinery-macros= { version = "0.4.0", path = "../refinery_macros" }

[dev-dependencies]
tokio-compat-02 = "~0.1.2"
barrel = { version = "0.6", features = ["sqlite3", "pg", "mysql"] }
futures = "0.3"
assert_cmd = "0.12"
Expand Down
5 changes: 3 additions & 2 deletions refinery/tests/mysql_async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod mysql_async {
use refinery_core::mysql_async::prelude::Queryable;
use refinery_core::{mysql_async, tokio};
use std::panic::AssertUnwindSafe;
use tokio_compat_02::FutureExt as _;

fn get_migrations() -> Vec<Migration> {
let migration1 = Migration::unapplied(
Expand Down Expand Up @@ -65,8 +66,8 @@ mod mysql_async {
}

async fn run_test<T: std::future::Future<Output = ()>>(t: T) {
let result = AssertUnwindSafe(t).catch_unwind().await;
clean_database().await;
let result = AssertUnwindSafe(t).catch_unwind().compat().await;
clean_database().compat().await;
assert!(result.is_ok());
}

Expand Down
6 changes: 3 additions & 3 deletions refinery_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ url = "2.0"
walkdir = "2.3.1"

rusqlite = {version = ">= 0.23, < 0.25", optional = true}
postgres = {version = "0.17", optional = true}
postgres = {version = "0.18", optional = true}
mysql = {version = "18", optional = true}
tokio-postgres = { version = "0.5", optional = true }
tokio-postgres = { version = "0.6", optional = true }
mysql_async = { version = "0.25", optional = true }

tokio = { version = "0.2", features = ["full"], optional = true }
tokio = { version = "0.3", features = ["full"], optional = true }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tokio-compat-02 crate uses the stream feature of Tokio 0.3, not of 0.2.

Oh sorry, I pasted wrong link...
This code enables full feature of Tokio 0.3 but error occurs.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it's marked optional? If it isn't enabled, it wouldn't have an effect.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's enabled by refinery crate (for which we did test)


[dev-dependencies]
tempfile = "3.1.0"
Expand Down