OHDSI / WhiteRabbit

WhiteRabbit is a small application that can be used to analyse the structure and contents of a database as preparation for designing an ETL. It comes with RabbitInAHat, an application for interactive design of an ETL to the OMOP Common Data Model with the help of the the scan report generated by White Rabbit.
http://ohdsi.github.io/WhiteRabbit
Apache License 2.0
183 stars 90 forks source link

WhiteRabbit Cannot connect to PosgreSQL datbase where schema has uppercase letters #416

Open Intisma opened 3 months ago

Intisma commented 3 months ago

Issue Description:

When testing the connection to the database where the schema name contains uppercase letters, I encounter the following error: Unable to retrieve table names for database Schema_name. In this message, the schema name is displayed correctly with uppercase letters. However, upon inspecting the connection made to the database, I noticed that the query sent was: SELECT table_name FROM information_schema.tables WHERE table_schema = 'schema_name' ORDER BY table_name In this query, the schema name is converted to all lowercase letters. I attempted to use double quotes around the schema name, but it still transformed all letters to lowercase.

Question:

Is there any way to use WhiteRabbit with schema names that contain uppercase letters? I have read-only access to the database and cannot modify the schema names.

Intisma commented 3 months ago

I modified the code and was able to use the program with uppercase schemas. I made minimal modifications to DBConnection.java, specifically by removing the forced lowercase transformation and adding double quotes to the section that sets the working path. This change was necessary because PostgreSQL automatically lowercases text that is not enclosed in double quotes.