Merge pull request #1069 from sqlpage/set-odbc-rpath-linux

fix: detect system odbc drivers on debian
This commit is contained in:
Ophir LOJKINE
2025-10-27 15:24:40 +01:00
committed by GitHub
3 changed files with 14 additions and 1 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ jobs:
db_url: "mssql://root:Password123!@127.0.0.1/sqlpage"
- database: odbc
container: postgres
db_url: "Driver=/usr/lib/x86_64-linux-gnu/odbc/psqlodbcw.so;Server=127.0.0.1;Port=5432;Database=sqlpage;UID=root;PWD=Password123!"
db_url: "Driver=PostgreSQL Unicode;Server=127.0.0.1;Port=5432;Database=sqlpage;UID=root;PWD=Password123!"
setup_odbc: true
steps:
- uses: actions/checkout@v4
+1
View File
@@ -8,6 +8,7 @@
- SQLPage now sets the [`Server-Timing` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Server-Timing) in development. So when you have a page that loads slowly, you can open your browser's network inspector, click on the slow request, then open the timing tab to understand where it's spending its time.
- <img width="1250" height="1263" alt="image" src="https://github.com/user-attachments/assets/6781a31f-e342-4e8c-8506-bc47049ce313" />
- Fixed a memory corruption issue in the builtin odbc driver manager
- ODBC: fix using globally installed system drivers by their name in debian-based linux distributions.
## v0.38.0
+12
View File
@@ -29,6 +29,7 @@ async fn main() {
] {
h.await.unwrap();
}
set_odbc_rpath();
}
fn make_client() -> awc::Client {
@@ -171,3 +172,14 @@ fn make_url_path(url: &str) -> PathBuf {
);
sqlpage_artefacts.join(filename)
}
/// On debian-based linux distributions, odbc drivers are installed in /usr/lib/<target>-linux-gnu/odbc
/// which is not in the default library search path.
fn set_odbc_rpath() {
if cfg!(all(target_os = "linux", feature = "odbc-static")) {
println!(
"cargo:rustc-link-arg=-Wl,-rpath,/usr/lib/{}-linux-gnu/odbc",
std::env::var("TARGET").unwrap().split('-').next().unwrap()
);
}
}