Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
ebd481c
feat: Add ODBC driver support
cursoragent Sep 19, 2025
52fbe88
Refactor: Implement OdbcConnection::execute
cursoragent Sep 19, 2025
fcf7628
feat: Add ODBC driver support
cursoragent Sep 19, 2025
ce5f82e
Refactor: Remove unused odbc query execution logic
cursoragent Sep 19, 2025
7869e86
feat: Implement streaming execution for ODBC connections
cursoragent Sep 19, 2025
bdc62ba
feat: Add ODBC test configuration and workflow
lovasoa Sep 19, 2025
a590b35
Merge remote-tracking branch 'refs/remotes/origin/cursor/implement-od…
lovasoa Sep 19, 2025
a21c637
fmt
lovasoa Sep 19, 2025
bfd4dd4
odbc tests
lovasoa Sep 19, 2025
f05b2c2
feat: Add additional ODBC tests for null values, numeric expressions,…
lovasoa Sep 19, 2025
33a0317
feat: Implement ODBC argument encoding and decoding
lovasoa Sep 19, 2025
2629cf0
refactor: Organize ODBC module imports and enhance type information i…
lovasoa Sep 19, 2025
f42f69f
refactor: Simplify ODBC connection execution and enhance SQL handling
lovasoa Sep 19, 2025
00b97f9
feat: Enhance ODBC execution with parameterized SQL handling
lovasoa Sep 19, 2025
297eff2
feat: Add dynamic and heterogeneous parameter binding tests for ODBC
lovasoa Sep 19, 2025
ea50336
feat: Implement custom handling for Option<T> in ODBC arguments
lovasoa Sep 19, 2025
eb20995
feat: Introduce OdbcDataType enum and enhance OdbcTypeInfo structure
lovasoa Sep 20, 2025
dfd328d
fix: Update all-databases entry in Cargo.toml to include 'odbc'
lovasoa Sep 20, 2025
384ddf9
chore: Update test.sh to include Docker command for PostgreSQL setup …
lovasoa Sep 20, 2025
1a1b5ba
chore: Update VSCode settings for rust-analyzer with new check comman…
lovasoa Sep 20, 2025
0f5d72b
feat: Add PostgreSQL 16 service without SSL to Docker Compose configu…
lovasoa Sep 20, 2025
c8ff45a
replace the OdbcDataType enum with direct usage of the DataType from …
lovasoa Sep 20, 2025
de6c9e9
add more odbc types support
lovasoa Sep 20, 2025
aa5d658
feat: Add support for unsigned integers and slice types in ODBC
lovasoa Sep 20, 2025
4bc1bcd
feat: Add new ODBC test for types and improve compatibility checks
lovasoa Sep 20, 2025
89130fc
refactor: Move Encode and Decode implementations to types module
lovasoa Sep 20, 2025
3a3e0fe
feat: Add ODBC support to the Any database driver
lovasoa Sep 20, 2025
62c4bdf
chore: Remove ODBC feature from clippy checks in CI workflow
lovasoa Sep 20, 2025
eae840b
refactor: Simplify trait generation for database encoding, decoding, …
lovasoa Sep 21, 2025
890417e
refactor: Consolidate feature combination macros for encoding, decodi…
lovasoa Sep 21, 2025
189d4db
refactor: Update feature combination macros for database trait genera…
lovasoa Sep 21, 2025
64c63f9
fmt
lovasoa Sep 21, 2025
2d3fd2b
[allow(clippy::approx_constant)]
lovasoa Sep 21, 2025
28852da
refactor: Remove lifetime parameters from OdbcArguments and related t…
lovasoa Sep 21, 2025
328a558
refactor: Simplify argument handling in ODBC command execution
lovasoa Sep 21, 2025
4c0d4f2
chore: Update ODBC configuration and CI workflow for PostgreSQL support
lovasoa Sep 21, 2025
270417a
Add odbc-sqlite test to CI
cursoragent Sep 19, 2025
8b90d35
feat: Improve ODBC connection string parsing
cursoragent Sep 21, 2025
597db7d
odbc: DSN parsing (odbc:Name -> DSN=Name); chrono/uuid decoding robus…
cursoragent Sep 21, 2025
f704cd8
feat: ODBC statement preparation
lovasoa Sep 21, 2025
4d0ccdd
Auto-commit pending changes before rebase - PR synchronize
cursoragent Sep 21, 2025
4f6adc1
fmt: apply formatting in ODBC worker and tests
cursoragent Sep 21, 2025
9d4e17a
refactor: Enhance ODBC command structure and utility functions
lovasoa Sep 21, 2025
0bfd4cc
test: Add comprehensive error handling tests for ODBC connections and…
lovasoa Sep 21, 2025
7898a0d
chore: Add 'either' dependency and update ODBC test imports
lovasoa Sep 21, 2025
ec0f1d6
chore: Update ODBC test commands to run with single test thread
lovasoa Sep 21, 2025
0ad3649
feat: Enhance ODBC connection string support
lovasoa Sep 21, 2025
f15a3cc
tests(any/odbc): fix clippy single-match by using if let
cursoragent Sep 21, 2025
cd3c053
odbc(chrono): accept numeric-reported types; parse compact YYYYMMDD f…
cursoragent Sep 21, 2025
ee28c30
fix(chrono): return NaiveDate directly instead of wrapping in and_hms…
lovasoa Sep 21, 2025
2de1174
feat(odbc): add Debug derive to OdbcValueRef and enhance UUID decodin…
lovasoa Sep 21, 2025
8cd2a6e
fix(odbc): handle datetime parsing without timezone info
lovasoa Sep 21, 2025
aa4c2b6
fix(odbc): use decode-only test for padded datetime strings
lovasoa Sep 21, 2025
06a8680
fix(odbc): add BigInt compatibility for bool type
lovasoa Sep 21, 2025
5c9a9e6
fix(odbc): use exact binary fractions for f32 tests to avoid precisio…
lovasoa Sep 21, 2025
4dc9444
fix(odbc): use IS NOT DISTINCT FROM for NULL-safe comparisons in tests
lovasoa Sep 21, 2025
91b8f0e
fix(odbc): use decode-only test for padded UUID strings
lovasoa Sep 21, 2025
72729b4
fix(odbc): use shared ODBC environment to prevent concurrency issues
lovasoa Sep 21, 2025
b72ac91
fix(odbc): streamline datetime parsing logic in Decode implementations
lovasoa Sep 21, 2025
5f73583
fix(odbc): adjust comment formatting in f32 tests for consistency
lovasoa Sep 21, 2025
832caea
fix(odbc): reorganize UUID tests and include additional decoding cases
lovasoa Sep 21, 2025
3ca58f4
fix(odbc): implement Drop for OdbcConnection to properly shut down wo…
lovasoa Sep 21, 2025
8db5cd3
fix(odbc): update type in assertion for fetched rows from u16 to i32
lovasoa Sep 21, 2025
c61fcb8
fix(odbc): replace static ODBC environment with direct environment in…
lovasoa Sep 21, 2025
d73aa05
fix(odbc): simplify thread spawning in ConnectionWorker
lovasoa Sep 21, 2025
eebdcd9
add timeout for odbc tests
lovasoa Sep 21, 2025
2c3c9f5
clean up odbc testing on ci
lovasoa Sep 22, 2025
4cdf84f
fix(odbc): implement Drop for ConnectionWorker to ensure proper shutd…
lovasoa Sep 22, 2025
6cfd1d8
fix(odbc): improve error handling in worker thread communication
lovasoa Sep 22, 2025
56f6f37
fix(odbc): test ODBC on multiple threads
lovasoa Sep 22, 2025
0073218
fix(odbc): correctly propagate errors when the client of the worker t…
lovasoa Sep 22, 2025
ee3b1cc
feat(odbc): implement missing types
lovasoa Sep 22, 2025
ee20c89
fix(odbc): update float test values for accuracy
lovasoa Sep 22, 2025
cdd6fe4
do not enforce string to float compatibility in odbc
lovasoa Sep 22, 2025
3b79516
fix(odbc): update f64 test value for consistency
lovasoa Sep 22, 2025
6e5e263
feat(odbc): add dbms_name method to retrieve database management syst…
lovasoa Sep 22, 2025
f863bbd
chore(ci): upgrade workflow runners to ubuntu-24.04 and remove rust-t…
lovasoa Sep 22, 2025
6e569c2
fix(ci): update ODBC installation in workflow to include missing unix…
lovasoa Sep 22, 2025
4623233
feat(odbc): enhance type compatibility and decoding for various data …
lovasoa Sep 22, 2025
4f4c30c
odbc tests: install missing deps on ci
lovasoa Sep 22, 2025
d451a19
refactor(pool): simplify database URL handling and improve SQL statem…
lovasoa Sep 22, 2025
ba23ae7
refactor(pool): clean up SQL statement formatting and remove unnecess…
lovasoa Sep 22, 2025
92a40fb
Refactor: Improve ODBC execute and prepare logic
cursoragent Sep 22, 2025
f4f6d87
test(any): adjust date handling for SQLite compatibility in chrono tests
lovasoa Sep 23, 2025
d37918b
ci: update SQLx workflow to install ODBC dependencies and adjust test…
lovasoa Sep 23, 2025
6b3fc84
refactor(odbc): implement statement manager for clearer code
lovasoa Sep 23, 2025
aa8fc4f
refactor(odbc): pass connection reference to StatementManager for imp…
lovasoa Sep 23, 2025
04a2df3
refactor(odbc): enhance statement caching with improved logging
lovasoa Sep 23, 2025
9fb8ab0
refactor(odbc): enhance command processing and error handling
lovasoa Sep 23, 2025
b9d8b75
ci: update SQLx workflow to use sudo for ODBC dependency installation…
lovasoa Sep 23, 2025
55e410b
refactor(odbc): streamline decoding logic and enhance error handling
lovasoa Sep 23, 2025
f3aa52c
refactor(odbc): fix OdbcRow and OdbcValue to contain correctly decode…
lovasoa Sep 23, 2025
8419112
fix clippy warnings and mssql test err
lovasoa Sep 23, 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
116 changes: 61 additions & 55 deletions .github/workflows/sqlx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@ on:
jobs:
format:
name: Format
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- run: cargo fmt --all -- --check


check:
name: Check
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
runtime: [async-std, tokio]
tls: [native-tls, rustls]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-sqlx
Expand All @@ -46,35 +44,22 @@ jobs:
cargo clippy \
--no-default-features \
--all-targets \
--features offline,all-databases,migrate,runtime-${{ matrix.runtime }}-${{ matrix.tls }} \
--features offline,all-databases,all-types,migrate,runtime-${{ matrix.runtime }}-${{ matrix.tls }} \
-- -D warnings

test:
name: Unit Test
runs-on: ubuntu-22.04
strategy:
matrix:
runtime: [
# Disabled because of https://github.com/rust-lang/cargo/issues/12964
# async-std,
# actix,
tokio
]
tls: [
# native-tls,
rustls
]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-sqlx
save-if: ${{ false }}
- run:
cargo test
--manifest-path sqlx-core/Cargo.toml
--features offline,all-databases,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
- run: sudo apt-get update && sudo apt-get install -y libodbc2 unixodbc-dev
- run: cargo test
--manifest-path sqlx-core/Cargo.toml
--features offline,all-databases,all-types,runtime-tokio-rustls

cli:
name: CLI Binaries
Expand All @@ -92,32 +77,29 @@ jobs:
target: x86_64-pc-windows-msvc
bin: target/debug/cargo-sqlx.exe
# FIXME: macOS build fails because of missing pin-project-internal
# - os: macOS-latest
# target: x86_64-apple-darwin
# bin: target/debug/cargo-sqlx
# - os: macOS-latest
# target: x86_64-apple-darwin
# bin: target/debug/cargo-sqlx

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-sqlx
save-if: ${{ github.ref == 'refs/heads/main' }}
- run:
cargo build
--manifest-path sqlx-cli/Cargo.toml
--bin cargo-sqlx
${{ matrix.args }}
- run: cargo build
--manifest-path sqlx-cli/Cargo.toml
--bin cargo-sqlx
${{ matrix.args }}

- uses: actions/upload-artifact@v4
with:
name: cargo-sqlx-${{ matrix.target }}
path: ${{ matrix.bin }}


sqlite:
name: SQLite
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
runtime: [async-std, tokio, actix]
Expand All @@ -126,7 +108,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: mkdir /tmp/sqlite3-lib && wget -O /tmp/sqlite3-lib/ipaddr.so https://github.com/nalgeon/sqlean/releases/download/0.15.2/ipaddr.so
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-sqlx
Expand All @@ -138,20 +119,19 @@ jobs:
--no-default-features \
--features sqlite,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }},macros,migrate \
-- -D warnings
- run:
cargo test
--no-default-features
--features any,macros,migrate,sqlite,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--
--test-threads=1
- run: cargo test
--no-default-features
--features any,macros,migrate,sqlite,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
--
--test-threads=1
env:
DATABASE_URL: sqlite://tests/sqlite/sqlite.db
RUSTFLAGS: --cfg sqlite_ipaddr
LD_LIBRARY_PATH: /tmp/sqlite3-lib

postgres:
name: Postgres
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
postgres: [14, 10]
Expand All @@ -161,8 +141,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-sqlx
Expand Down Expand Up @@ -207,11 +185,10 @@ jobs:

postgres_ssl_client_cert:
name: Postgres with SSL client cert
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: check
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-sqlx
Expand All @@ -225,7 +202,7 @@ jobs:

mysql:
name: MySQL
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
mysql: [8, 5_7]
Expand All @@ -235,8 +212,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-sqlx
Expand Down Expand Up @@ -270,7 +245,7 @@ jobs:

mariadb:
name: MariaDB
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
mariadb: [10_6, 10_3]
Expand All @@ -280,8 +255,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-sqlx
Expand All @@ -308,7 +281,7 @@ jobs:

mssql:
name: MSSQL
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
matrix:
mssql: [2019, 2022]
Expand All @@ -318,8 +291,6 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-sqlx
Expand All @@ -343,3 +314,38 @@ jobs:
cargo test --no-default-features --features any,mssql,macros,migrate,all-types,runtime-${{ matrix.runtime }}-${{ matrix.tls }}
env:
DATABASE_URL: mssql://sa:Password123!@localhost/sqlx

odbc:
name: ODBC (PostgreSQL and SQLite)
runs-on: ubuntu-24.04
needs: check
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
prefix-key: v1-sqlx
shared-key: odbc
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Start Postgres (no SSL)
run: |
docker compose -f tests/docker-compose.yml run -d -p 5432:5432 --name postgres_16_no_ssl postgres_16_no_ssl
docker exec postgres_16_no_ssl bash -c "until pg_isready; do sleep 1; done"
- name: Install unixODBC and ODBC drivers (PostgreSQL, SQLite)
run: |
sudo apt-get update
sudo apt-get install -y unixodbc odbcinst unixodbc-common libodbcinst2 odbc-postgresql libsqliteodbc libodbc2 unixodbc-dev
odbcinst -j
- name: Configure system/user DSN for PostgreSQL
run: |
cp tests/odbc.ini ~/.odbc.ini
odbcinst -q -s || true
echo "select 1;" | isql -v SQLX_PG_5432 || true
- name: Run ODBC tests (PostgreSQL DSN)
run: cargo test --no-default-features --features any,odbc,macros,all-types,runtime-tokio-rustls
env:
DATABASE_URL: DSN=SQLX_PG_5432;UID=postgres;PWD=password
- name: Run ODBC tests (SQLite driver)
run: cargo test --no-default-features --features any,odbc,macros,all-types,runtime-tokio-rustls
env:
DATABASE_URL: Driver={SQLite3};Database=./tests/odbc/sqlite.db
Loading
Loading