Issue description
getTable() does not return table metadata in Oracle 12c when the table name is provided in lowercase, even though the table was created without quoted identifiers and works correctly in standard SQL queries.
Expected Behavior
getTable('test1') should return the table metadata when the table exists in Oracle 12c and was created without quoted identifiers (e.g., CREATE TABLE TEST1).
Since Oracle automatically normalizes unquoted identifiers to uppercase, the method should either:
- Handle case normalization internally for Oracle, or
- Behave consistently with how Oracle resolves table names in SQL queries.
Actual Behavior
When calling:
await dataSource.driver.getTable('test1');
The method does not return the expected table metadata.
However, the following works:
await dataSource.driver.getTable('TEST1');
This inconsistency causes failures when using lowercase table names.
Steps to reproduce
- Use Oracle Database 12c.
- Create a table without quoted identifiers:
CREATE TABLE TEST1 (
id NUMBER
);
- Connect to the database using TypeORM.
- Attempt to retrieve the table metadata using lowercase:
await dataSource.driver.getTable('test1');
- Observe that the table is not found.
- Repeat using uppercase:
await dataSource.driver.getTable('TEST1');
- Observe that it works correctly.
My Environment
- TypeORM version: 0.3.20
- Database: Oracle Database 12c
- Node.js version: 22.17.1
- Operating System: Ubuntu 24.04 (WSL)
- Additional dependencies (if any): None
Additional Context
In Oracle 12c, unquoted identifiers are automatically stored in uppercase. While standard SQL queries are case-insensitive for such identifiers, the getTable() method appears to perform a case-sensitive lookup against database metadata.
This creates inconsistency between:
- SQL execution behavior (
SELECT * FROM test1)
- Metadata retrieval behavior (
getTable('test1'))
A possible improvement would be either:
- Normalizing table names to uppercase internally for Oracle, or
- Clearly documenting that Oracle requires uppercase table names when using
getTable().
This would improve consistency and prevent confusion for users working with Oracle.
Relevant Database Driver(s)
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.