Skip to content

cargo install cargo-sqlx should work #3872

Open
@Arjentix

Description

@Arjentix

I have found these related issues/pull requests

Haven't found any

Description

In Rust ecosystem it's more common to name cli packages for cargo as cargo-my-package, so for sqlx I'd suggest cargo-sqlx. I understand that sqlx-cli may be positioned as not just cargo extension.

The reason I'm suggesting this is that I got an error in my code advising me to run cargo sqlx prepare. I haven't had sqlx-cli installed and the first thing I tried was cargo install cargo-sqlx, glad it didn't worked and forced me to look how to properly install sqlx-cli.

This naming inconvenience creates a vulnerability for fishing attacks if someone will publish a crate with this name. And considering the fact that database data often is quite sensible it would be very bad.

I suggest either rename sqlx-cli to cargo-sqlx or show error message with just sqlx prepare or together with installation step.

Reproduction steps

Set SQLX_OFFLINE=true and DATABASE_URL in your environment.

In Rust code use for example query_as_unchecked!.

SQLx version

0.8.5

Enabled SQLx features

macros

Database server and version

Postgress

Operating system

MacOs

Rust version

rustc 1.84.0 (9fc6b4312 2025-01-07)

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliConcerns `sqlx-cli`questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions