Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions .github/workflows/sqlx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ jobs:

- uses: Swatinem/rust-cache@v2

- run: cargo build --features mysql,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
- run: cargo build --features mysql,mysql-compression,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}

- run: docker compose -f tests/docker-compose.yml run -d -p 3306:3306 --name mysql_${{ matrix.mysql }} mysql_${{ matrix.mysql }}
- run: sleep 60
Expand All @@ -354,7 +354,7 @@ jobs:
- run: >
cargo test
--no-default-features
--features any,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
--features any,mysql,macros,mysql-compression,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx?ssl-mode=disabled
SQLX_OFFLINE_DIR: .sqlx
Expand All @@ -365,7 +365,7 @@ jobs:
cargo test
--test mysql-test-attr
--no-default-features
--features any,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
--features any,mysql,macros,mysql-compression,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx?ssl-mode=disabled
SQLX_OFFLINE_DIR: .sqlx
Expand All @@ -376,7 +376,7 @@ jobs:
run: >
cargo test
--no-default-features
--features any,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
--features any,mysql,macros,mysql-compression,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
SQLX_OFFLINE_DIR: .sqlx
Expand All @@ -390,7 +390,7 @@ jobs:
cargo build
--no-default-features
--test mysql-macros
--features any,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
--features any,mysql,macros,mysql-compression,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
SQLX_OFFLINE: true
SQLX_OFFLINE_DIR: .sqlx
Expand All @@ -402,7 +402,7 @@ jobs:
cargo test
--no-default-features
--test mysql-macros
--features any,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
--features any,mysql,macros,mysql-compression,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
SQLX_OFFLINE: true
Expand All @@ -421,7 +421,7 @@ jobs:
run: >
cargo test
--no-default-features
--features any,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
--features any,mysql,macros,mysql-compression,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root@localhost:3306/sqlx?sslmode=verify_ca&ssl-ca=.%2Ftests%2Fcerts%2Fca.crt&ssl-key=.%2Ftests%2Fcerts%2Fkeys%2Fclient.key&ssl-cert=.%2Ftests%2Fcerts%2Fclient.crt
RUSTFLAGS: --cfg mysql_${{ matrix.mysql }}
Expand All @@ -444,7 +444,7 @@ jobs:

- uses: Swatinem/rust-cache@v2

- run: cargo build --features mysql,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
- run: cargo build --features mysql,mysql-compression,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}

- run: docker compose -f tests/docker-compose.yml run -d -p 3306:3306 --name mariadb_${{ matrix.mariadb }} mariadb_${{ matrix.mariadb }}
- run: sleep 30
Expand All @@ -455,7 +455,7 @@ jobs:
- run: >
cargo test
--no-default-features
--features any,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
--features any,mysql,macros,mysql-compression,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
SQLX_OFFLINE_DIR: .sqlx
Expand All @@ -466,7 +466,7 @@ jobs:
cargo test
--test mysql-test-attr
--no-default-features
--features any,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
--features any,mysql,macros,mysql-compression,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
SQLX_OFFLINE_DIR: .sqlx
Expand All @@ -491,7 +491,7 @@ jobs:
cargo test
--no-default-features
--test mysql-macros
--features any,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
--features any,mysql,macros,mysql-compression,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root:password@localhost:3306/sqlx
SQLX_OFFLINE: true
Expand All @@ -510,7 +510,7 @@ jobs:
run: >
cargo test
--no-default-features
--features any,mysql,macros,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
--features any,mysql,macros,mysql-compression,migrate,_unstable-all-types,runtime-${{ matrix.runtime }},tls-${{ matrix.tls }}
env:
DATABASE_URL: mysql://root@localhost:3306/sqlx?sslmode=verify_ca&ssl-ca=.%2Ftests%2Fcerts%2Fca.crt&ssl-key=.%2Ftests%2Fcerts%2Fkeys%2Fclient.key&ssl-cert=.%2Ftests%2Fcerts%2Fclient.crt
RUSTFLAGS: --cfg mariadb="${{ matrix.mariadb }}"
68 changes: 68 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ uuid = ["sqlx-core/uuid", "sqlx-macros?/uuid", "sqlx-mysql?/uuid", "sqlx-postgre
regexp = ["sqlx-sqlite?/regexp"]
bstr = ["sqlx-core/bstr"]

# compression
mysql-compression = ["sqlx-mysql/compression"]

[workspace.dependencies]
# Core Crates
sqlx-core = { version = "=0.9.0-alpha.1", path = "sqlx-core" }
Expand Down Expand Up @@ -359,7 +362,7 @@ required-features = ["sqlite"]
[[test]]
name = "mysql"
path = "tests/mysql/mysql.rs"
required-features = ["mysql"]
required-features = ["mysql", "compression"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of requiring the compression feature, you should either just #[cfg] out those tests or create a new test target.


[[test]]
name = "mysql-types"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ be removed in the future.

- `mysql`: Add support for the MySQL/MariaDB database server.

- `mysql-compression`: Add compression support for MySQL/MariaDB database server.

- `mssql`: Add support for the MSSQL database server.

- `sqlite`: Add support for the self-contained [SQLite](https://sqlite.org/) database engine with SQLite bundled and statically-linked.
Expand Down
5 changes: 5 additions & 0 deletions sqlx-mysql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ json = ["sqlx-core/json", "serde"]
any = ["sqlx-core/any"]
offline = ["sqlx-core/offline", "serde/derive"]
migrate = ["sqlx-core/migrate"]
compression = ["zstd", "flate2"]

# Type Integration features
bigdecimal = ["dep:bigdecimal", "sqlx-core/bigdecimal"]
Expand Down Expand Up @@ -67,6 +68,10 @@ stringprep = "0.1.2"
tracing = { version = "0.1.37", features = ["log"] }
whoami = { version = "1.2.1", default-features = false }

# Compression
zstd = { version = "0.13.3", optional = true, default-features = false, features = ["zdict_builder"] }
flate2 = { version = "1.1.5", optional = true, default-features = false, features = ["rust_backend", "zlib"] }
Comment on lines +72 to +73
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be better if these were under separate features. Most of the time, the user should know which compression algorithms their server supports and it can be pretty annoying to deal with building dependencies you don't need.


dotenvy.workspace = true
thiserror.workspace = true

Expand Down
Loading
Loading