microsoft / mssql-jdbc

The Microsoft JDBC Driver for SQL Server is a Type 4 JDBC driver that provides database connectivity with SQL Server through the standard JDBC application program interfaces (APIs).
MIT License
1.06k stars 428 forks source link

Support SYNONYM as a table type for DatabaseMetadata methods #1814

Open dqmdev opened 2 years ago

dqmdev commented 2 years ago

SQL Server JDBC 10.2 and older versions.

Unlike other database vendors, SQL Server JDBC driver does not deal with synonyms.

DatabaseMetadata interface methods return nothing.

DatabaseMetadata.getTableTypes does not include anything regarding synonyms

DatabaseMetadata.getTables does not return anything regarding objects (tables/views) synonym references.

...

This feature limitation has been raised several times over many years, as it impacts products relying on the JDBC API methods.

Adding hard coded SQL to navigate catalog tables as a workaround is not ideal, and not required with other vendors.

tkyc commented 2 years ago

Hi @dqmdev, we'll plan and triage this feature in our semester planning.

dqmdev commented 1 year ago

Is there any expectation that this will be addressed in 2023?

lilgreenbird commented 1 year ago

hi @dqmdev

At this point it seems unlikely. We do semester planning twice a year we have to allocate resources to those bugs and features which are higher priority. Please note that we have to consider severity of issue, impact, complexity, and the number of upvotes/requests from users. Please feel free to fill out our survey if you have features or bug fixes that you would like to see in the future as our product manager does look at these and take them into consideration.

dqmdev commented 1 year ago

@lilgreenbird

When SQL Server introduced synonyms, it did not account for those table types re the JDBC driver, as it did re ODBC driver etc. Which was noted to Microsoft SQL Server team.

This forces applications to bypass using JDBC standard Metadata methods, and issue direct queries on the catalog tables. Ideally applications let the driver abstract how metadata is persisted within the catalog tables.

Unclear why SQL Server JDBC continues to have this gap. Is the current SQL Server product management team aware of the gap the driver?

Meanwhile other vendors who had or added SYNONYMS ensured their JDBC drivers functions (getTableTypes, getTables...).