Skip to content

Add Java and driver versions to SQL error report - #344

Merged
schuemie merged 1 commit into
OHDSI:developfrom
DG47:fix/error-report-java-version
Oct 19, 2026
Merged

schuemie merged 1 commit into
OHDSI:developfrom
DG47:fix/error-report-java-version

Conversation

@DG47

@DG47 DG47 commented Oct 13, 2026

Copy link
Copy Markdown

Fixes #267

The SQL error report (errorReportSql.txt) now includes the Java version and, as suggested in the issue comments, the driver version:

  • Java version, from java.lang.System.getProperty("java.version").
  • For JDBC connections: the JDBC driver name and version from DatabaseMetaData (for example PostgreSQL JDBC Driver (42.7.3)).
  • For DBI connections (DuckDB, SQLite, or a plain DBI connection passed to querySql() / executeSql()): the DBI driver package and its version (for example duckdb (1.5.6)).

These lines appear after Platform: in the system info section. Each lookup is wrapped in tryCatch() and falls back to Unknown, so the report is still written when the connection is broken.

.createErrorReport() has a new optional connection argument, and all five call sites (executeSql() twice, querySql(), renderTranslateQueryApplyBatched(), and querySqlToAndromeda()) pass the connection. Nothing else changes, and NEWS.md is not touched.

Example report section (Postgres):

Platform:
aarch64-apple-darwin27.0.0

Java version:
17.0.20.1

JDBC driver:
PostgreSQL JDBC Driver (42.7.3)

Attached base packages:
...

Tests: the new tests/testthat/test-errorReport.R loops over the test servers and checks the report for both JDBC connections (Postgres) and DBI connections (SQLite, DuckDB). It also has one test with a plain duckdb DBI connection. I ran it against PostgreSQL 16 in Docker plus the local SQLite and DuckDB servers. It fails on develop and passes with this change. R CMD check --no-manual --ignore-vignettes gives Status: OK.

The error report now lists the Java version, and the JDBC driver name
and version for JDBC connections (or the DBI driver package and version
for DBI connections). Fixes OHDSI#267
@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 39 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (46f8bbc) to head (b155278).

Files with missing lines Patch % Lines
R/Sql.R 0.00% 38 Missing ⚠️
R/Andromeda.R 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #344       +/-   ##
===========================================
- Coverage    55.84%   0.00%   -55.85%     
===========================================
  Files           16      16               
  Lines         2770    2803       +33     
===========================================
- Hits          1547       0     -1547     
- Misses        1223    2803     +1580     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@schuemie
schuemie merged commit c7a5bed into OHDSI:develop Oct 19, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants