async-sqlx-session icon indicating copy to clipboard operation
async-sqlx-session copied to clipboard

Crate depends on async_std for seemingly no reason

Open CyrusAlbright opened this issue 3 years ago • 3 comments

Trying to integrate this crate into a project using Warp which is built on Tokio, so I'm using the sqlx crate with the runtime-tokio-native-tls option, but in this crate, the first line of the features in the Cargo.toml file is default = ["native-tls"] which leads to further down the features list native-tls = ["sqlx/runtime-async-std-native-tls"], so it's using a conflicting sqlx runtime.

It looks like recent efforts were made on this crate to move away from a dependency on async-std, so I would appreciate if this could be fixed. To keep current projects working, it should be possible to keep the existing defaults and have a feature to enable using the Tokio runtime.

CyrusAlbright avatar Jun 29 '21 01:06 CyrusAlbright

I think it would need a build script because of how SQLx's features system works, so I'll see if I can make one and have a pull request up. Ideally I'll not have to change much.

CyrusAlbright avatar Jun 29 '21 01:06 CyrusAlbright

Nevermind. Build scripts execute after everything else has been compiled. I guess there's nothing to do here other than add SQLx's own features system to this crate. I'll get a PR up as soon as I can. Unfortunately I think this will have to break current compatibility, so best to make it a new version.

CyrusAlbright avatar Jun 29 '21 03:06 CyrusAlbright

Alright, I've made a pull request.

https://github.com/jbr/async-sqlx-session/pull/25

CyrusAlbright avatar Jun 29 '21 04:06 CyrusAlbright