fix: Update SqlConversationRepository to use ODBC instead of SQL Server Client#327
Open
Ragini-Microsoft wants to merge 1 commit intomainfrom
Open
fix: Update SqlConversationRepository to use ODBC instead of SQL Server Client#327Ragini-Microsoft wants to merge 1 commit intomainfrom
Ragini-Microsoft wants to merge 1 commit intomainfrom
Conversation
…client for database connections
.NET Unit Test Results201 tests 201 ✅ 1s ⏱️ Results for commit 74b690e. |
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.
Purpose
This pull request refactors the
SqlConversationRepositoryclass to use ODBC for all database operations instead of the previous mix ofSqlClientand Azure Identity. The code now consistently usesOdbcConnectionand parameterized queries with positional parameters, simplifying the authentication and connection logic for both production and development environments. Additionally, exception handling and parameter usage have been updated to match these changes.Migration to ODBC for Database Access:
Replaced all usage of
SqlConnection,SqlCommand, andSqlParameterwithOdbcConnection,OdbcCommand, and positional parameters throughoutSqlConversationRepository. This includes all CRUD operations for conversations and messages. [1] [2] [3] [4] [5] [6] [7] [8] [9]Updated all SQL queries to use
?as parameter placeholders (required by ODBC) instead of named parameters (e.g.,@c,@u). Parameters are now added in the correct order usingAddWithValue. [1] [2] [3] [4] [5] [6] [7] [8]Connection and Authentication Logic:
FABRIC_SQL_CONNECTION_STRINGwith ODBC; in development, it builds an ODBC connection string withActiveDirectoryInteractiveauthentication, removing Azure Identity and token management. TheIAzureCredentialFactorydependency was removed. [1] [2]Exception Handling Updates:
OdbcExceptioninstead ofSqlExceptionand improved the general exception filter to avoid swallowing ODBC and related exceptions. [1] [2]These changes ensure consistent use of ODBC for SQL Server access, reduce external dependencies, and make the codebase easier to maintain and deploy across environments.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation