Skip to content

Enabling migrate feature also adds mysql #3207

@rafaelGuerreiro

Description

@rafaelGuerreiro

Bug Description

I'm not sure this bug belongs to sqlx or cargo/rust.

When using sqlx = { version = "0.7.4", default-features = false, features = ["postgres"]}, only sqlx, sqlx-core, sqlx-macros, and sqlx-postgres are loaded.

But when I add "migrate", or "uuid", or "chrono", I also see "sqlx-mysql", and "sqlx-sqlite" in my Cargo.lock file.

Minimal Reproduction

Cargo.toml

[package]
name = "test-sqlx"
version = "0.1.0"
edition = "2021"

[dependencies]
sqlx = { version = "0.7.4", default-features = false, features = ["postgres"]}

Results in this Cargo.lock

[[package]]
name = "sqlx"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa"
dependencies = [
 "sqlx-core",
 "sqlx-macros",
 "sqlx-postgres",
]

Cargo.toml

[package]
name = "test-sqlx"
version = "0.1.0"
edition = "2021"

[dependencies]
sqlx = { version = "0.7.4", default-features = false, features = ["postgres", "migrate"]}

Results in this Cargo.lock

[[package]]
name = "sqlx"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa"
dependencies = [
 "sqlx-core",
 "sqlx-macros",
 "sqlx-mysql",
 "sqlx-postgres",
 "sqlx-sqlite",
]

Info

  • SQLx version: 0.7.4
  • SQLx features enabled: postgres, migrate
  • Database server and version: Postgres (MySQL / Postgres / SQLite <x.y.z>)
  • Operating system: MacOS 14.4.1
  • rustc --version: rustc 1.77.2 (25ef9e3d8 2024-04-09)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbug:rustIndicates a bug or regression in Rust

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions