This repository contains the official Microsoft.Data.SqlClient library, the primary ADO.NET data provider for SQL Server and Azure SQL Database. It implements the full Tabular Data Stream (TDS) protocol, connection pooling (with both legacy WaitHandle-based and modern Channel-based implementations), Always Encrypted with enclave support, configurable retry logic, Azure Active Directory authentication, bulk copy operations, query notifications, and diagnostic instrumentation via ETW/EventSource. The codebase is highly engineered for production use, targeting .NET Framework, .NET Core, .NET 5+, and .NET Standard. It is accompanied by a rich ecosystem of companion packages for Azure Key Vault integration, authentication abstractions, and logging. The repository also includes extensive test suites (unit, functional, manual, stress, performance), simulated TDS server tools for protocol-level testing, and benchmarking infrastructure. The code is actively maintained with frequent dependency updates, security patches, and feature additions, reflecting a disciplined engineering process and strong backward-compatibility awareness.
FreeTDS is an open-source C library that implements the Tabular Data Stream (TDS) protocol, providing client connectivity to Sybase and Microsoft SQL Server databases. It exposes three API layers: DB-Library (compatible with Sybase/Microsoft's db-lib), CT-Library (Sybase's client library), and a full ODBC driver. The library also includes a connection pool server, server-side test infrastructure, and command-line tools such as `tsql`, `fisql`, `freebcp`, `bsqldb`, and `defncopy`. Core protocol handling lives in `src/tds/`, which manages login, authentication (NTLM, Kerberos, SSPI), encryption (TLS via OpenSSL or GnuTLS), packet framing, query submission, cursor management, and bulk copy. The architecture is layered and modular, with clean stream I/O, threading, and character conversion abstractions that make components independently reusable. The codebase is cross-platform (Unix, Windows, VMS) and supports TDS versions 4.2 through 8.0, adapting to server-specific behaviors. Despite its age and some legacy compatibility code, it remains actively maintained and widely used as a reliable database connectivity layer in production environments.