Skip to content

Update Readme.md quickstart example #1492

Closed
@loratera

Description

@loratera

https://github.com/launchbadge/sqlx/#quickstart

shows an old library version which is not compatible with current tokio runtime, an update would be nice and a more elaborated quickstart example for the tokio runtime, since the tokio runtime is mentioned in the example and commented out. Something like this would be better in my opinion:

[dependencies]
sqlx = { version = "0.5", features = [ "postgres" ] }
async-std = { version = "1.9", features = [ "attributes" ] }

# or for tokio runtime
# sqlx = { version = "0.5", features = [ "runtime-tokio-rustls" , "postgres" ] }
# tokio = { version = "1", features = ["full"] }

also I saw from a pull request #1479 that the async-std runtime is not on by default, so it even has to be like this (but untested):

[dependencies]
sqlx = { version = "0.5", features = [ "runtime-async-std-native-tls", "postgres" ] }
async-std = { version = "1.9", features = [ "attributes" ] }

# or for tokio runtime
# sqlx = { version = "0.5", features = [ "runtime-tokio-rustls" , "postgres" ] }
# tokio = { version = "1", features = ["full"] }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions