@@ -17,6 +17,16 @@ lto = "fat"
1717panic = " abort"
1818codegen-units = 2
1919
20+ [features ]
21+ # Build variants
22+ # - default (odbc-dynamic): ODBC enabled, dynamically linked (works on Linux, macOS, Windows)
23+ # - odbc-static: ODBC enabled, statically linked to the driver manager (Linux only)
24+ # - disable ODBC entirely: use `--no-default-features`
25+ default = [" odbc-dynamic" ]
26+ odbc = [" sqlx/odbc" ]
27+ odbc-dynamic = [" odbc" ]
28+ odbc-static = [" odbc" , " odbc-sys/static" ]
29+
2030[dependencies ]
2131sqlx = { package = " sqlx-oldapi" , git = " https://github.com/sqlpage/sqlx-oldapi" , version = " 0.6.49-beta.6" , default-features = false , features = [
2232 " any" ,
@@ -26,7 +36,6 @@ sqlx = { package = "sqlx-oldapi", git = "https://github.com/sqlpage/sqlx-oldapi"
2636 " postgres" ,
2737 " mysql" ,
2838 " mssql" ,
29- " odbc" ,
3039 " chrono" ,
3140 " bigdecimal" ,
3241 " json" ,
@@ -75,6 +84,7 @@ clap = { version = "4.5.17", features = ["derive"] }
7584tokio-util = " 0.7.12"
7685openidconnect = { version = " 4.0.0" , default-features = false }
7786encoding_rs = " 0.8.35"
87+ odbc-sys = { version = " 0.27" , optional = true }
7888
7989[build-dependencies ]
8090awc = { version = " 3" , features = [" rustls-0_23-webpki-roots" ] }
@@ -84,8 +94,4 @@ libflate = "2"
8494futures-util = " 0.3.21"
8595
8696[target .'cfg(all(unix, not(target_os = "macos")))' .dependencies ]
87- # Enable static linking of unixODBC only on Linux/Unix, not on Windows/macOS
88- odbc-sys = { version = " 0.27" , features = [" static" ] }
89-
90- [target .'cfg(any(target_os = "windows", target_os = "macos"))' .dependencies ]
91- odbc-sys = { version = " 0.27" }
97+ odbc-sys = { version = " 0.27" , optional = true , features = [] }
0 commit comments