How dotnet/sqlclient works
Microsoft.Data.SqlClient is a .NET data provider for SQL Server and Azure SQL. The primary workflow is an application opening a connection, issuing database work, and consuming results; the README establishes the provider’s role, but the excerpts do not show the full command-to-TDS call chain. The graph also preserves authentication and Always Encrypted capabilities. Connections beyond explicit README or SOURCE INDEX references are omitted; unsampled implementation details are represented only where the tree or CORE MODULES line identifies them.
Main entry points: ActiveDirectoryAuthenticationProvider.cs Azure authentication · SqlColumnEncryptionAzureKeyVaultProvider.cs Azure Key Vault provider · SqlConnection.cs SQL connection · SqlAuthenticationProviderManager.cs Authentication manager
Components 21
Provider runtime
- SQL connection
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlConnection.cs - Command execution
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlCommand.NonQuery.cs - Data reader
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlDataReader.cs - Bulk copy
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlBulkCopy.cs - Transactions
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlTransaction.cs
Connection and protocol
- Connection pooling
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ConnectionPool/DbConnectionPoolGroup.cs - Internal connection
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/Connection/SqlConnectionInternal.cs - TDS parser
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParser.cs - TDS state
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/TdsParserStateObject.cs - Managed SNI
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ManagedSni/SniProviders.netcore.cs
Authentication and encryption
- Authentication manager
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs - Column key providers
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlColumnEncryptionKeyStoreProvider.cs
Provider extensions
- Authentication abstractions
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationParameters.cs - Authentication methods
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationMethod.cs - Authentication token
src/Microsoft.Data.SqlClient.Extensions/Abstractions/src/SqlAuthenticationToken.cs - Azure authentication
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs - Azure Key Vault provider
src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/SqlColumnEncryptionAzureKeyVaultProvider.cs - Key cryptography
src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/AzureSqlKeyCryptographer.cs - Key cache
src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/LocalCache.cs
Other components
- Application
- SQL Server / Azure SQL
Connections 9
- Application → SQL connection: opens connection
README.md - SQL connection → SQL Server / Azure SQL: connects to
README.md - Authentication manager → Azure authentication: loads provider
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlAuthenticationProviderManager.cs - Azure authentication → Authentication methods: uses methods
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs - Azure authentication → Authentication abstractions: uses parameters
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs - Azure authentication → Authentication token: returns tokens
src/Microsoft.Data.SqlClient.Extensions/Azure/src/ActiveDirectoryAuthenticationProvider.cs - Azure Key Vault provider → Key cryptography: delegates crypto
src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/SqlColumnEncryptionAzureKeyVaultProvider.cs - Azure Key Vault provider → Key cache: uses cache
src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/SqlColumnEncryptionAzureKeyVaultProvider.cs - Azure Key Vault provider → Column key providers: implements provider
src/Microsoft.Data.SqlClient.AlwaysEncrypted.AzureKeyVaultProvider/src/SqlColumnEncryptionAzureKeyVaultProvider.cs