Skip to content

Azure SQL: Use username; include DB for uniqueness#34

Merged
brandochn merged 1 commit intomainfrom
bugfixes
Mar 4, 2026
Merged

Azure SQL: Use username; include DB for uniqueness#34
brandochn merged 1 commit intomainfrom
bugfixes

Conversation

@brandochn
Copy link
Owner

This pull request introduces several improvements to connection uniqueness logic, Azure SQL Profiler session templates, and the handling of recent connections in the application. The main focus is on ensuring that connections are uniquely identified by server, user, and database, and updating templates and UI logic to reflect the correct fields for Azure SQL versus SQL Server. Comprehensive unit tests are also added to verify these behaviors.

Connection uniqueness improvements:

  • Modified the recent connection saving logic to consider InitialCatalog (database name) in addition to DataSource and UserId when determining if a connection is unique, ensuring connections to the same server and user but different databases are treated as distinct.
  • Added a new unit test class ConnectionUniquenessTests to thoroughly verify that connection uniqueness is determined by the combination of server, user, and database, including case-insensitive comparisons and various authentication/engine scenarios.

Azure SQL Profiler session template updates:

  • Updated the Azure SQL Profiler session template to use sqlserver.username instead of sqlserver.nt_username and removed sqlserver.server_principal_name from the captured actions, ensuring compatibility with Azure SQL auditing requirements.
  • Added unit tests to verify that the Azure SQL template uses the correct fields and omits those not supported by Azure SQL, while the SQL Server template retains the original fields.

Recent connections UI and data model enhancements:

  • Updated the RecentConnectionsPresenter to store and retrieve EngineType and AuthenticationMode in the recent connections grid, ensuring these properties are preserved and correctly restored when selecting a recent connection. [1] [2] [3]
  • Added the necessary using directives for AuthenticationMode and improved the data table schema to include the new fields.

These changes collectively enhance the accuracy and reliability of connection management and profiling in the application.

Resolves: #27

Use sqlserver.username (instead of nt_username) and remove
server_principal_name in the Azure SQL profiler template. Also
include InitialCatalog when checking/recording connection uniqueness
so connections are distinct per database. Add unit tests for both
behaviors.
@brandochn brandochn merged commit ccb99e3 into main Mar 4, 2026
1 check passed
@brandochn brandochn deleted the bugfixes branch March 4, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Azure SQL Database incompatibility

1 participant