We're excited to announce the release of go-mssqldb v1.10.0, the official Microsoft Go driver for SQL Server and Azure SQL Database. This release brings significant reliability improvements, better standards compliance, and a smoother developer onboarding experience.
Highlights
Detect Server-Aborted Transactions (XACT_ABORT)
One of the most impactful fixes in this release addresses a subtle but dangerous bug: when SQL Server aborts a transaction due to XACT_ABORT ON, the driver now correctly detects this state. Previously, a silently aborted transaction could lead to subsequent statements being auto-committed outside the intended transaction boundary, potentially causing data integrity issues. The driver now returns a clear error when you attempt to use a connection whose transaction was server-aborted. (#370)
Implement driver.DriverContext Interface
The driver now implements Go's driver.DriverContext interface, enabling sql.OpenDB-style usage and better integration with connection pool configuration via sql.DB.SetConnMaxLifetime, SetMaxOpenConns, etc. This brings the driver in line with modern Go database/sql conventions. (#365)
Surface Errors from Rows.Close()
Previously, server errors that occurred during the token drain phase of Rows.Close() were silently swallowed. Now these errors are properly surfaced to callers, making it much easier to diagnose issues like permission errors or constraint violations that manifest during result set cleanup. (#361)
Nullable Civil Types for Date/Time Parameters
New nullable types (civil.NullDate, civil.NullTime, civil.NullDateTime) allow you to pass nullable date/time parameters without resorting to *time.Time or raw interface{} values. These integrate cleanly with the database/sql scanner and valuer interfaces. (#325)
DevContainer for Instant Development
Getting started with go-mssqldb development is now as simple as opening the repo in VS Code or GitHub Codespaces. The new devcontainer configuration includes a SQL Server instance, pre-configured environment variables, and all required tooling. (#317)
All Changes
Features
- Add devcontainer for VS Code and GitHub Codespaces (#317)
- Add FailoverPartnerSPN connection string parameter (#327)
- Add NewConnectorWithProcessQueryText for mssql driver compatibility (#341)
- Add nullable civil types for date/time parameters (#325)
Bug Fixes
- Allow named pipe protocol support for ARM64 Windows (#232)
- Detect server-aborted transactions to prevent silent auto-commit with XACT_ABORT (#370)
- Expose TrustServerCertificate in msdsn.Config and URL round-trip (#312)
- Handle COLINFO and TABNAME TDS tokens returned by tables with triggers (#343)
- Implement driver.DriverContext interface (#365)
- Make readCancelConfirmation respect context cancellation (#359)
- Return interface{} scanType for sql_variant instead of nil (#362)
- Sanitize credentials from connection string parsing errors (#319)
- Surface server errors from Rows.Close() during token drain (#361)
Upgrade
go get github.com/microsoft/go-mssqldb@v1.10.0
This release requires Go 1.21+ and is fully compatible with SQL Server 2012 through 2022 and Azure SQL Database.
Contributing
We welcome contributions! The new devcontainer makes it easier than ever to get started. Open the repo in VS Code, reopen in the container, and you'll have a full development environment with SQL Server ready to go.