SQL Server integrity enhancement support in supportsIntegrityEnhancementFacility #2745 - #2828
Merged
Divang Sharma (divang) merged 1 commit intoNov 4, 2025
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2828 +/- ##
============================================
+ Coverage 51.51% 56.28% +4.77%
- Complexity 4081 4520 +439
============================================
Files 149 149
Lines 34268 34378 +110
Branches 5725 5734 +9
============================================
+ Hits 17654 19351 +1697
+ Misses 14125 12397 -1728
- Partials 2489 2630 +141 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Mahendra Chavan (machavan)
approved these changes
Nov 4, 2025
Ananya Garg (Ananya2)
approved these changes
Nov 4, 2025
This was referenced Nov 18, 2025
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem:
The DatabaseMetaData.supportsIntegrityEnhancementFacility() method incorrectly returns false for SQL Server databases. This method is part of the JDBC specification and indicates whether the database supports integrity enhancement facilities such as primary key and foreign key constraints. SQL Server has comprehensive support for these integrity features, but the driver was not accurately reporting this capability to applications. This could lead to applications incorrectly assuming that SQL Server lacks integrity constraint support, potentially affecting application logic and database schema decisions.
Root Cause:
The supportsIntegrityEnhancementFacility() method in SQLServerDatabaseMetaData.java was hardcoded to return false. This was an incorrect implementation as SQL Server fully supports integrity enhancement facilities including:
Primary key constraints
Foreign key constraints
Check constraints
Unique constraints
NOT NULL constraints
The method implementation did not reflect the actual capabilities of SQL Server, causing a mismatch between the database's features and what the driver reported.
Solution:
Updated the supportsIntegrityEnhancementFacility() method in SQLServerDatabaseMetaData.java to return true instead of false. This change aligns the driver's reported capabilities with SQL Server's actual support for integrity enhancement facilities. The fix ensures that applications using this metadata method will receive accurate information about SQL Server's constraint support capabilities.