Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
4641cff
initial compile-time support
bobozaur Jun 6, 2025
f164429
re-export sqlx
bobozaur Jun 6, 2025
c5d1b98
tweak feature flags
bobozaur Jun 6, 2025
8dbcc38
more feature flags cleanup
bobozaur Jun 6, 2025
1acfd71
various fixes
bobozaur Jun 6, 2025
6068aa8
cosmetic changes
bobozaur Jun 6, 2025
a860116
fix MigrateDatabase::database_exists
bobozaur Jun 6, 2025
abc96c8
Use git SQLx dependencies
bobozaur Jun 6, 2025
fbd5944
Fix MigrateDatabase::drop_database
bobozaur Jun 6, 2025
b088b5a
Remove DATABASE_URL from Zed settings
bobozaur Jun 6, 2025
6fee18c
Bump MSRV
bobozaur Jun 6, 2025
eb7d748
Fix CI clippy
bobozaur Jun 6, 2025
7d1cf21
More CI fixes
bobozaur Jun 6, 2025
9410486
Remove obsolete comments
bobozaur Jun 6, 2025
375ff99
Use upstream sqlx
bobozaur Jul 11, 2025
c70b28a
Fix comment
bobozaur Jul 11, 2025
a8efd4f
tweak feature flags
bobozaur Jul 11, 2025
e1e1fef
Compile time query fixes
bobozaur Jul 12, 2025
b5e6976
draft
bobozaur Jul 14, 2025
bc15bc5
tweak CLI and test that it's installable
bobozaur Jul 17, 2025
c0fb9ad
various fixes
bobozaur Jul 17, 2025
72b1463
compile time query fixes
bobozaur Jul 18, 2025
f0f0fe4
tweak array/iters impls
bobozaur Jul 18, 2025
7d4e164
add array types to compile-time support
bobozaur Jul 18, 2025
87dd690
improvements on compile time array types support
bobozaur Jul 19, 2025
ece06d6
add compile time tests for arrays
bobozaur Jul 21, 2025
05906d5
fix compile time migrations script
bobozaur Jul 22, 2025
e2cea4a
fix compile time migrations script
bobozaur Jul 22, 2025
a8ecd94
formatting
bobozaur Jul 22, 2025
1daedd5
data type tweaks
bobozaur Jul 23, 2025
6d63eb3
fix tests
bobozaur Jul 23, 2025
fc1de0f
more data type work
bobozaur Jul 24, 2025
3b9fd00
Removed ExaDataType::Null
bobozaur Jul 24, 2025
dd32227
Fix Json<T> impls
bobozaur Jul 24, 2025
4b33294
Implement ExaJsonStrFormatter
bobozaur Jul 25, 2025
88cfc0a
Completed JSON and ASCII features
bobozaur Jul 25, 2025
3dd7b61
Minor tweaks
bobozaur Jul 28, 2025
8d7caab
Inline date size_hint
bobozaur Jul 29, 2025
1167b05
get rid of ascii
bobozaur Jul 29, 2025
9a85e7c
extend tests and allow Uuid at compile-time
bobozaur Jul 29, 2025
aa18315
cargo fmt
bobozaur Jul 29, 2025
9368e0d
don't run clippy on tests
bobozaur Jul 29, 2025
71c3e89
Add DATABASE_URL to compile_time CI tests
bobozaur Jul 29, 2025
abc070a
ci update
bobozaur Jul 29, 2025
5ae38e2
don't run clippy on tests
bobozaur Jul 29, 2025
873b39c
lints and CI tweaks
bobozaur Jul 30, 2025
fb854e6
tweak compile time tests
bobozaur Jul 30, 2025
4c99216
CI tweaks
bobozaur Jul 30, 2025
3cfe0e0
CI fixes
bobozaur Jul 30, 2025
a75d4a6
use custom cert in dockerdb
bobozaur Jul 30, 2025
e5366c1
remove matrix from CI
bobozaur Jul 30, 2025
b319916
unroll CI loops
bobozaur Aug 1, 2025
f450b74
Remove runtime encode type checks
bobozaur Aug 2, 2025
3cffa0f
Implemented ConnectOptions::to_url_lossy
bobozaur Aug 2, 2025
0d8d7b9
use percent encoding in connect options
bobozaur Aug 2, 2025
521327c
Introduced CompressionMode
bobozaur Aug 2, 2025
9fb6a0f
Introduce IO tests
bobozaur Aug 2, 2025
68fabaa
Tweak Debug impl for ExaWriter and ExaReader; IO fixes
bobozaur Aug 3, 2025
4c56088
Fix CompressedWebSocket::poll_flush
bobozaur Aug 3, 2025
4f59e5f
formatting
bobozaur Aug 3, 2025
03a1ba7
Commented EncodingState
bobozaur Aug 3, 2025
0392036
Rename CompressionMode to ExaCompressionMode and add tests
bobozaur Aug 3, 2025
f6dc7ba
TLS feature cleanup and test fixes
bobozaur Aug 3, 2025
5495e9b
TLS feature flag tweaks
bobozaur Aug 3, 2025
a82e3ac
Reorganize CI
bobozaur Aug 3, 2025
4703826
Unified integration tests in a single crate
bobozaur Aug 3, 2025
2fe753a
formatting
bobozaur Aug 3, 2025
b3acb87
Remove ExaIntervalDayToSecond for Duration/TimeDelta
bobozaur Aug 3, 2025
b510d4e
Added rust-toolchain.toml
bobozaur Aug 8, 2025
2c23e02
Added HashType newtype
bobozaur Aug 9, 2025
d30a927
fix rust-toolchain.toml
bobozaur Aug 9, 2025
270a45a
Remove from ExaDataType variants
bobozaur Aug 9, 2025
47baa04
fix Uuid invalid tests
bobozaur Aug 9, 2025
9545196
Fix ExaDataTye::HashType comment
bobozaur Aug 9, 2025
68a147a
fix hashtype tests
bobozaur Aug 9, 2025
2c291a0
fix contention on it_switches_schema_from_attr test
bobozaur Aug 9, 2025
df0f8ea
geometry draft
bobozaur Aug 9, 2025
2488c7c
implement geometry tests
bobozaur Aug 10, 2025
094a1f9
formatting
bobozaur Aug 10, 2025
3f8d24a
Streamline ExaDataType::compatible
bobozaur Aug 10, 2025
4366202
Extend geometry compile time test
bobozaur Aug 10, 2025
1f67b33
Add bigdecimal tests
bobozaur Aug 10, 2025
733a696
rename geometry tests module to geo_types
bobozaur Aug 10, 2025
d9e01fc
Added time tests
bobozaur Aug 10, 2025
04063df
Make ProtocolVersion private
bobozaur Aug 10, 2025
92f5c19
Update prepared query files
bobozaur Aug 10, 2025
b19d98d
Tweak derives for custom types
bobozaur Aug 19, 2025
e34cc6c
Bump to latest sqlx commit
bobozaur Aug 19, 2025
cb1acf6
Split arguments module
bobozaur Aug 19, 2025
ca90fa1
Tweak MigrateDatabase impl
bobozaur Aug 19, 2025
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
43 changes: 31 additions & 12 deletions .github/actions/exa-cluster/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ inputs:
description: "Number of nodes to spawn in the cluster"
required: true
outputs:
no-tls-url:
description: "Connection string for the database with TLS disabled"
value: ${{ steps.connection-strings.outputs.no-tls-url }}
tls-url:
description: "Connection string for the database with TLS enabled"
value: ${{ steps.connection-strings.outputs.tls-url }}
url:
description: "Connection string for the database"
value: ${{ steps.connection-string.outputs.url }}
runs:
using: "composite"
steps:
Expand All @@ -39,13 +36,38 @@ runs:

- name: Initialize Exasol cluster
run: |
#############################
#### Create initial node ####
#############################

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

####################
#### Clone node ####
####################

for (( i=2; i<=${{ inputs.num-nodes }}; i++ )); do
sudo cp -R $HOME/sqlx1 $HOME/sqlx$i
done

################################
#### Generate TLS 1.3 certs ####
################################

sudo openssl genpkey -algorithm RSA -out ~/sqlx1/etc/ssl/ssl.ca.key -pkeyopt rsa_keygen_bits:2048
sudo openssl genpkey -algorithm RSA -out ~/sqlx1/etc/ssl/ssl.key -pkeyopt rsa_keygen_bits:2048

echo "basicConstraints=CA:FALSE" > $HOME/v3.ext
echo "keyUsage=digitalSignature,keyEncipherment" >> $HOME/v3.ext
echo "extendedKeyUsage=clientAuth,serverAuth" >> $HOME/v3.ext
echo "subjectAltName=DNS:exacluster.local" >> $HOME/v3.ext

sudo openssl req -x509 -new -nodes -key $HOME/sqlx1/etc/ssl/ssl.ca.key -sha256 -days 3650 -out $HOME/sqlx1/etc/ssl/ssl.ca -subj "/CN=exacluster.local"
sudo openssl req -new -key $HOME/sqlx1/etc/ssl/ssl.key -out $HOME/ssl.csr -subj "/CN=exacluster.local"
sudo openssl x509 -req -in $HOME/ssl.csr -CA $HOME/sqlx1/etc/ssl/ssl.ca -CAkey $HOME/sqlx1/etc/ssl/ssl.ca.key -CAcreateserial -out $HOME/sqlx1/etc/ssl/ssl.crt -days 365 -sha256 -extfile $HOME/v3.ext

shell: bash

- name: Start Exasol cluster
Expand All @@ -67,10 +89,7 @@ runs:
done
shell: bash

- 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
- name: Create connection string
id: connection-string
run: echo "url=exa://sys:[email protected]$NUM_NODES:8563" >> $GITHUB_OUTPUT
shell: bash
216 changes: 126 additions & 90 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,74 +30,43 @@ jobs:
- name: Check format
run: cargo +nightly fmt --check

clippy:
name: Clippy
needs: format
docs:
name: Docs
runs-on: ubuntu-latest
strategy:
matrix:
etl:
[
"--features etl_native_tls",
"--features etl_rustls",
"--features etl",
"",
]
other: ["--features compression,migrate,rust_decimal,uuid,chrono", ""]
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
- uses: dtolnay/[email protected]

- uses: dtolnay/[email protected]
with:
components: clippy

- name: Run clippy
run: cargo clippy --tests ${{ matrix.etl }} ${{ matrix.other }}
env:
RUSTFLAGS: -D warnings

check_windows:
name: Check Windows builds
needs: clippy
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2

- uses: dtolnay/[email protected]
with:
components: clippy

- name: Run clippy
run: cargo clippy --tests --features compression,migrate,etl,rust_decimal,uuid,chrono
- name: Check format
run: cargo doc --workspace --no-deps --document-private-items --all-features
env:
RUSTFLAGS: -D warnings
# See: https://aws.github.io/aws-lc-rs/resources.html#troubleshooting
AWS_LC_SYS_NO_ASM: 1
RUSTDOCFLAGS: -D warnings

check_mac_os:
name: Check MacOS builds
needs: clippy
runs-on: macos-latest
clippy:
name: Clippy
needs: [format, docs]
runs-on: ubuntu-latest
strategy:
matrix:
features: ["--all-features", ""]
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2

- uses: dtolnay/rust-toolchain@1.85.0
- uses: dtolnay/rust-toolchain@1.86.0
with:
components: clippy

- name: Run clippy
run: cargo clippy --tests --features compression,migrate,etl,rust_decimal,uuid,chrono
run: cargo clippy --tests ${{ matrix.features }}
env:
RUSTFLAGS: -D warnings

connection_tests:
name: Connection tests
io_tests:
name: IO tests
needs: clippy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

Expand All @@ -112,26 +81,55 @@ jobs:
exasol-version: ${{ env.EXASOL_VERSION }}
num-nodes: ${{ env.NUM_NODES }}

- uses: dtolnay/rust-toolchain@1.85.0
- uses: dtolnay/rust-toolchain@1.86.0
- uses: Swatinem/rust-cache@v2

- name: Connection tests
- name: Test IO combos (no TLS, no compression)
timeout-minutes: ${{ fromJSON(env.TESTS_TIMEOUT) }}
run: cargo test --features migrate,rust_decimal,uuid,chrono -- --nocapture
run: cargo test --features runtime-tokio,etl -- it_works_with_io_combo --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.no-tls-url }}

- name: Connection tests with compression
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}
SQLX_OFFLINE: true

- name: Test IO combos (no TLS, with compression)
timeout-minutes: ${{ fromJSON(env.TESTS_TIMEOUT) }}
run: cargo test --features runtime-tokio,etl,compression -- it_works_with_io_combo --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}
SQLX_OFFLINE: true

- name: Test IO combos (NativeTLS, no compression)
timeout-minutes: ${{ fromJSON(env.TESTS_TIMEOUT) }}
run: cargo test --features runtime-tokio,etl,tls-native-tls -- it_works_with_io_combo --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}
SQLX_OFFLINE: true

- name: Test IO combos (NativeTLS, with compression)
timeout-minutes: ${{ fromJSON(env.TESTS_TIMEOUT) }}
run: cargo test --features runtime-tokio,etl,tls-native-tls,compression -- it_works_with_io_combo --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}
SQLX_OFFLINE: true

- name: Test IO combos (Rustls, no compression)
timeout-minutes: ${{ fromJSON(env.TESTS_TIMEOUT) }}
run: cargo test --features runtime-tokio,etl,tls-rustls-aws-lc-rs -- it_works_with_io_combo --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}
SQLX_OFFLINE: true

- name: Test IO combos (Rustls, with compression)
timeout-minutes: ${{ fromJSON(env.TESTS_TIMEOUT) }}
run: cargo test --features migrate,compression -- --ignored --nocapture
run: cargo test --features runtime-tokio,etl,tls-rustls-aws-lc-rs,compression -- it_works_with_io_combo --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.no-tls-url }}
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}
SQLX_OFFLINE: true

tls_connection_tests:
name: TLS connection tests
driver_tests:
name: Driver tests
needs: clippy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

Expand All @@ -146,26 +144,65 @@ jobs:
exasol-version: ${{ env.EXASOL_VERSION }}
num-nodes: ${{ env.NUM_NODES }}

- uses: dtolnay/rust-toolchain@1.85.0
- uses: dtolnay/rust-toolchain@1.86.0
- uses: Swatinem/rust-cache@v2

- name: Drop database (non-existent)
run: cargo run -p sqlx-exasol-cli -- database drop -y
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}/test

- name: Setup database
run: cargo run -p sqlx-exasol-cli -- database create
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}/test

- name: Run migrations
run: cargo run -p sqlx-exasol-cli -- migrate run --source tests/migrations_compile_time
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}/test

- name: Run prepare
run: cargo run -p sqlx-exasol-cli -- prepare -- --tests --all-features
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}/test

- name: TLS connection tests
- name: Run tests (preferred crates)
run: cargo test --features runtime-tokio,bigdecimal,time,uuid -- test_compile_time --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}/test

- name: Run tests (chrono)
run: cargo test --features runtime-tokio,chrono -- test_compile_time_chrono --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}/test

- name: Run tests (rust_decimal)
run: cargo test --features runtime-tokio,rust_decimal -- test_compile_time_rust_decimal --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}/test

- name: Unit tests
timeout-minutes: ${{ fromJSON(env.TESTS_TIMEOUT) }}
run: cargo test --features migrate,rust_decimal,uuid,chrono -- --nocapture
run: cargo test -p sqlx-exasol-impl --features migrate -- --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.tls-url }}
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}/test

- name: TLS connection tests with compression
- name: Integration connection tests
timeout-minutes: ${{ fromJSON(env.TESTS_TIMEOUT) }}
run: cargo test --features migrate,compression -- --ignored --nocapture
run: cargo test --all-features -- --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}/test?ssl-mode=disabled&compression=disabled

- name: Drop database (existent)
run: cargo run -p sqlx-exasol-cli -- database drop -y
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.tls-url }}
DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}/test

etl_tests:
name: ETL tests
needs: clippy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

Expand All @@ -180,33 +217,32 @@ jobs:
exasol-version: ${{ env.EXASOL_VERSION }}
num-nodes: ${{ env.NUM_NODES }}

- uses: dtolnay/rust-toolchain@1.85.0
- uses: dtolnay/rust-toolchain@1.86.0
- uses: Swatinem/rust-cache@v2

- name: ETL tests
- name: ETL tests (no TLS)
timeout-minutes: ${{ fromJSON(env.TESTS_TIMEOUT) }}
run: cargo test --features migrate,compression,etl -- --ignored --nocapture --test-threads `nproc`
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.no-tls-url }}

- name: ETL without TLS feature but TLS connection (should fail)
run: cargo test --features migrate,etl -- --ignored --nocapture --test-threads `nproc` || true
run: |
export DATABASE_URL="$BASE_DATABASE_URL?ssl-mode=disabled"
cargo test --features runtime-tokio,compression,etl -- test_etl --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.tls-url }}

- name: Tests compilation failure if both ETL TLS features are enabled
run: cargo test --features etl_native_tls,etl_rustls || true
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.tls-url }}

- name: Native-TLS ETL tests
BASE_DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}
SQLX_OFFLINE: true

- name: ETL tests (NativeTLS)
timeout-minutes: ${{ fromJSON(env.TESTS_TIMEOUT) }}
run: cargo test --features migrate,compression,etl_native_tls -- --ignored --nocapture --test-threads `nproc`
run: |
export DATABASE_URL="$BASE_DATABASE_URL?ssl-mode=required"
cargo test --features runtime-tokio,compression,etl,tls-native-tls -- test_etl --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.tls-url }}

- name: Rustls ETL tests
BASE_DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}
SQLX_OFFLINE: true

- name: ETL tests (Rustls)
timeout-minutes: ${{ fromJSON(env.TESTS_TIMEOUT) }}
run: cargo test --features migrate,compression,etl_rustls -- --ignored --nocapture --test-threads `nproc`
run: |
export DATABASE_URL="$BASE_DATABASE_URL?ssl-mode=required"
cargo test --features runtime-tokio,compression,etl,tls-rustls-aws-lc-rs -- test_etl --ignored --nocapture
env:
DATABASE_URL: ${{ steps.exa-cluster.outputs.tls-url }}
BASE_DATABASE_URL: ${{ steps.exa-cluster.outputs.url }}
SQLX_OFFLINE: true

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

Loading
Loading