Skip to content

Commit

Permalink
Update to sqlx = v0.8.2 (#27)
Browse files Browse the repository at this point in the history
* Updated to v0.8.2

* Fix lints

* Remove flate2 dependency

* Fix CI database setup due to exasol Docker image changes

* Fix self-signed certificate generation due to dependencies version update

* Increase timeouts in CI

* Make use of rustls CryptoProvider in tests

* Fix Windows cargo check

* Update CHANGELOG
  • Loading branch information
bobozaur authored Sep 5, 2024
1 parent f421ec8 commit 7d0ce46
Show file tree
Hide file tree
Showing 43 changed files with 456 additions and 473 deletions.
47 changes: 27 additions & 20 deletions .github/actions/exa-cluster/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,38 +33,45 @@ runs:
run: docker image load --input ~/ci/cache/docker/exasol-${{ inputs.exasol-version }}.tar
shell: bash

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Set up Docker network
run: docker network create --driver=bridge --subnet=10.10.10.0/24 sqlx
shell: bash

- name: Install dependencies
- name: Initialize Exasol cluster
run: |
python -m pip install --upgrade pip
pip install pipenv
docker run -v $HOME/sqlx1:/exa --rm --privileged -i exasol/docker-db:${{ inputs.exasol-version }} init-sc --template --num-nodes ${{ inputs.num-nodes }}
docker run --rm -v $HOME/sqlx1:/exa exasol/docker-db:${{ inputs.exasol-version }} exaconf modify-volume -n DataVolume1 -s 4GiB
sudo truncate -s 6G $HOME/sqlx1/data/storage/dev.1
for (( i=2; i<=${{ inputs.num-nodes }}; i++ )); do
sudo cp -R $HOME/sqlx1 $HOME/sqlx$i
done
shell: bash

- uses: actions/checkout@v3
with:
repository: Exasol/docker-db
ref: ${{ inputs.exasol-version }}
- name: Start Exasol cluster
run: |
for (( i=1; i<=${{ inputs.num-nodes }}; i++ )); do
docker run --name sqlx$i --detach --network=sqlx --ip 10.10.10.1$i --privileged --stop-timeout 120 -v $HOME/sqlx$i:/exa exasol/docker-db:${{ inputs.exasol-version }} init-sc --node-id 1$i
done
shell: bash

- name: Set up Exasol Cluster
- name: Wait until Exasol cluster is live
run: |
pipenv install -r exadt_requirements.txt
pipenv run ./exadt create-cluster --root ~/sqlx --create-root sqlx
pipenv run ./exadt init-cluster --image exasol/docker-db:${{ inputs.exasol-version }} --license ./license/license.xml --num-nodes ${{ inputs.num-nodes }} --auto-storage sqlx
pipenv run ./exadt start-cluster sqlx
set +e
RC=1
while [[ $RC -ne 0 ]]; do
docker exec sqlx1 /bin/bash -c '`find /usr/opt -name exaplus | head -1` -c localhost:8563 -u sys -p exasol -sql "SELECT * FROM DUAL;"' &>/dev/null
RC=$?
sleep 5
done
shell: bash

# The exadt tool always creates the Exasol cluster with this subnet
# The Exasol cluster is created with this subnet by default
- name: Create connection strings
id: connection-strings
run: |
DATABASE_URL="exa://sys:[email protected]$NUM_NODES:8563"
echo "no-tls-url=$DATABASE_URL?ssl-mode=disabled" >> $GITHUB_OUTPUT
echo "tls-url=$DATABASE_URL?ssl-mode=required" >> $GITHUB_OUTPUT
shell: bash

# Checkout the main repository again
- uses: actions/checkout@v3
17 changes: 15 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
pull_request:
branches: ["main"]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
RUST_TOOLCHAIN: 1.74.0
EXASOL_VERSION: 7.0.22
NUM_NODES: 2
NUM_NODES: 4
ETL_TEST_THREADS: 4
ETL_JOB_TIMEOUT: 20
ETL_JOB_TIMEOUT: 15
EXA_CLUSTER_SETUP_TIMEOUT: 15

jobs:
format:
Expand Down Expand Up @@ -88,6 +93,9 @@ jobs:
with:
command: check
args: --tests --features compression,migrate,etl,rust_decimal,uuid,chrono
# See: https://aws.github.io/aws-lc-rs/resources.html#troubleshooting
env:
AWS_LC_SYS_NO_ASM: 1

check_mac_os:
name: Check MacOS builds
Expand Down Expand Up @@ -122,6 +130,7 @@ jobs:
uses: ./.github/actions/free-space

- name: Create Exasol cluster
timeout-minutes: ${{ fromJSON(env.EXA_CLUSTER_SETUP_TIMEOUT) }}
id: exa-cluster
uses: ./.github/actions/exa-cluster
with:
Expand Down Expand Up @@ -159,6 +168,7 @@ jobs:
uses: ./.github/actions/free-space

- name: Create Exasol cluster
timeout-minutes: ${{ fromJSON(env.EXA_CLUSTER_SETUP_TIMEOUT) }}
id: exa-cluster
uses: ./.github/actions/exa-cluster
with:
Expand Down Expand Up @@ -196,6 +206,7 @@ jobs:
uses: ./.github/actions/free-space

- name: Create Exasol cluster
timeout-minutes: ${{ fromJSON(env.EXA_CLUSTER_SETUP_TIMEOUT) }}
id: exa-cluster
uses: ./.github/actions/exa-cluster
with:
Expand Down Expand Up @@ -239,6 +250,7 @@ jobs:
uses: ./.github/actions/free-space

- name: Create Exasol cluster
timeout-minutes: ${{ fromJSON(env.EXA_CLUSTER_SETUP_TIMEOUT) }}
id: exa-cluster
uses: ./.github/actions/exa-cluster
with:
Expand Down Expand Up @@ -272,6 +284,7 @@ jobs:
uses: ./.github/actions/free-space

- name: Create Exasol cluster
timeout-minutes: ${{ fromJSON(env.EXA_CLUSTER_SETUP_TIMEOUT) }}
id: exa-cluster
uses: ./.github/actions/exa-cluster
with:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.8.2] - 2024-09-05

### Added
- [#27](https://github.com/bobozaur/sqlx-exasol/pull/27): Update to sqlx `0.8.2`; Removed direct dependency on `flate2`.

## [0.7.4] - 2024-03-15

### Added
Expand Down
95 changes: 56 additions & 39 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sqlx-exasol"
version = "0.7.4"
version = "0.8.2"
edition = "2021"
authors = ["bobozaur"]
description = "Exasol driver for the SQLx framework."
Expand All @@ -11,25 +11,19 @@ exclude = ["tests/*"]
categories = ["database"]

[package.metadata.docs.rs]
features = ["etl", "chrono", "rust_decimal", "uuid"]
features = ["etl", "chrono", "rust_decimal", "uuid", "compression", "migrate"]

[features]
# ############################################
# ########### User-facing features ###########
# ############################################

compression = ["dep:async-compression", "dep:flate2"]
compression = ["dep:async-compression"]
uuid = ["dep:uuid"]
chrono = ["dep:chrono"]
rust_decimal = ["dep:rust_decimal"]
migrate = ["sqlx-core/migrate", "dep:dotenvy", "dep:hex"]
etl = [
"dep:hyper-util",
"dep:http-body-util",
"dep:hyper",
"dep:bytes",
"dep:futures-channel",
]
etl = ["dep:http-body-util", "dep:hyper", "dep:bytes", "dep:futures-channel"]
etl_rustls = ["dep:rustls", "dep:rcgen", "etl"]
etl_native_tls = ["dep:native-tls", "dep:rcgen", "etl"]

Expand All @@ -39,53 +33,76 @@ etl_native_tls = ["dep:native-tls", "dep:rcgen", "etl"]

[dependencies]
rand = "0.8.5"
base64 = "0.22.0"
thiserror = "1.0.58"
url = "2.5.0"
base64 = "0.22.1"
thiserror = "1.0.63"
url = "2.5.2"
rsa = "0.9.6"
async-tungstenite = "0.25.0"
async-tungstenite = "0.28.0"
futures-io = "0.3.30"
futures-util = "0.3.30"
futures-core = "0.3.30"
serde_json = { version = "1.0.114", features = ["raw_value"] }
serde = { version = "1.0.197", features = ["derive"] }
futures-channel = { version = "0.3.30", optional = true }
serde_json = { version = "1.0.128" }
serde = { version = "1.0.209", features = ["derive", "rc"] }
pin-project = "1.1.5"
lru = "0.12.3"
sqlx-core = "0.7.4"
sqlx-macros-core = "0.7.4"
lru = "0.12.4"
sqlx-core = "0.8.2"
tracing = { version = "0.1.40", features = ["log"] }
arrayvec = "0.7.4"
rcgen = { version = "0.12.1", optional = true }
tungstenite = "0.21.0"
arrayvec = "0.7.6"
rcgen = { version = "0.13.1", optional = true }

# Feature flagged optional dependencies
uuid = { version = "1.7.0", features = ["serde"], optional = true }
chrono = { version = "0.4.35", features = ["serde"], optional = true }
rust_decimal = { version = "1.34.3", optional = true }
uuid = { version = "1.10.0", features = ["serde"], optional = true }
chrono = { version = "0.4.38", features = ["serde"], optional = true }
rust_decimal = { version = "1.36.0", optional = true }
dotenvy = { version = "0.15.7", optional = true }
hex = { version = "0.4.3", optional = true }
flate2 = { version = "1.0.28", optional = true }
async-compression = { version = "0.4.6", features = [
async-compression = { version = "0.4.12", features = [
"futures-io",
"gzip",
"zlib",
], optional = true }
rustls = { version = "0.21", default-features = false, features = [
"dangerous_configuration",
rustls = { version = "0.23.12", default-features = false, features = [
"std",
"tls12",
], optional = true }
native-tls = { version = "0.2.11", optional = true }
hyper-util = { version = "0.1", features = ["full"], optional = true }
http-body-util = { version = "0.1", optional = true }
hyper = { version = "1.2.0", features = ["server", "http1"], optional = true }
bytes = { version = "1.5", optional = true }
futures-channel = { version = "0.3.30", optional = true }
native-tls = { version = "0.2.12", optional = true }
http-body-util = { version = "0.1.2", optional = true }
hyper = { version = "1.4.1", features = ["server", "http1"], optional = true }
bytes = { version = "1.7.1", optional = true }
serde-transcode = { version = "1.1.1" }

[dev-dependencies]
sqlx = { version = "0.7.4", features = [
rustls = { version = "0.23.12" }
sqlx = { version = "0.8.2", features = [
"runtime-tokio",
"tls-native-tls",
"migrate",
] }
paste = "1.0.14"
anyhow = "1.0.81"
tokio = { version = "1.36.0", features = ["full"] }
paste = "1.0.15"
anyhow = "1.0.86"
tokio = { version = "1.40.0", features = ["full"] }

[lints.clippy]
all = { level = "warn", priority = -1 }
pedantic = { level = "warn", priority = -1 }
struct_excessive_bools = "allow"
trivially_copy_pass_by_ref = "allow"
must_use_candidate = "allow"
match_bool = "allow"
module_name_repetitions = "allow"

[lints.rust]
rust_2018_idioms = { level = "warn", priority = -1 }
rust_2021_compatibility = { level = "warn", priority = -1 }
meta_variable_misuse = "warn"
missing_abi = "warn"
missing_copy_implementations = "warn"
missing_debug_implementations = "warn"
non_ascii_idents = "warn"
trivial_casts = "warn"
trivial_numeric_casts = "warn"
unused_extern_crates = "warn"
unused_import_braces = "warn"
unused_lifetimes = "warn"
unused_qualifications = "warn"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Inspired by [Py-Exasol](https://github.com/exasol/pyexasol) and based on the (no
>
> With that in mind, please favor using a fixed version of `sqlx` and `sqlx-exasol` in `Cargo.toml` to avoid issues, such as:
> ```toml
> sqlx = "=0.7.4"
> sqlx-exasol = "=0.7.4"
> sqlx = "=0.8.2"
> sqlx-exasol = "=0.8.2"
> ```
Expand Down
Loading

0 comments on commit 7d0ce46

Please sign in to comment.