Skip to content

Update Readme.md quickstart example #1492

Closed

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"] }

Activity

  1. acro5piano commented on Nov 1, 2021

    @acro5piano

    @loratera Thanks, you saved my day!

  2. added 2 commits that reference this issue on Nov 19, 2021
    6cdb35d
    b5a95c4
  3. added a commit that references this issue on Feb 29, 2024
    35c5e32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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