HoneyDrunk.Data.SqlServer 0.3.0

dotnet add package HoneyDrunk.Data.SqlServer --version 0.3.0
                    
NuGet\Install-Package HoneyDrunk.Data.SqlServer -Version 0.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="HoneyDrunk.Data.SqlServer" Version="0.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HoneyDrunk.Data.SqlServer" Version="0.3.0" />
                    
Directory.Packages.props
<PackageReference Include="HoneyDrunk.Data.SqlServer" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add HoneyDrunk.Data.SqlServer --version 0.3.0
                    
#r "nuget: HoneyDrunk.Data.SqlServer, 0.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package HoneyDrunk.Data.SqlServer@0.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HoneyDrunk.Data.SqlServer&version=0.3.0
                    
Install as a Cake Addin
#tool nuget:?package=HoneyDrunk.Data.SqlServer&version=0.3.0
                    
Install as a Cake Tool

HoneyDrunk.Data.SqlServer

SQL Server family specialization for HoneyDrunk.Data, covering SQL Server, Azure SQL Database, and Azure SQL Managed Instance.

Purpose

Provides SQL Server-specific configuration, optional conventions, and diagnostics. This package builds on the EF Core provider layer with SQL Server-specific wiring.

Allowed Dependencies

  • HoneyDrunk.Data.EntityFramework - The EF Core provider layer
  • Microsoft.EntityFrameworkCore.SqlServer - SQL Server EF Core provider (includes relational and ADO.NET types transitively)
  • HoneyDrunk.Standards - Analyzer package only (PrivateAssets=all)

What Must Never Be Added

  • No other database providers - PostgreSQL, MySQL, etc. belong in their own projects
  • No transport or auth references - HoneyDrunk.Transport and HoneyDrunk.Auth are not data concerns
  • No provider-agnostic EF abstractions - Base implementations belong in HoneyDrunk.Data.EntityFramework; this package contains SQL Server-specific wiring only

Namespace Layout

HoneyDrunk.Data.SqlServer
├── Conventions/          # Optional SQL Server model conventions
│   └── SqlServerModelConventions.cs
├── Diagnostics/          # SQL Server health contributor
│   └── SqlServerHealthContributor.cs
└── Registration/         # DI extensions
    ├── ServiceCollectionExtensions.cs
    └── SqlServerDataOptions.cs

Usage

// Orchestration layer required
services.AddHoneyDrunkData();

// Register SQL Server provider
services.AddHoneyDrunkDataSqlServer<MyDbContext>(sqlOptions =>
{
    sqlOptions.ConnectionString = configuration.GetConnectionString("Default")
        ?? throw new InvalidOperationException("Connection string required");
    sqlOptions.EnableRetryOnFailure = true;
    sqlOptions.MaxRetryCount = 3;
});

SQL Server Conventions (Optional)

These conventions are opt-in utilities, not applied by default. They can be called from either ApplyConfigurations or ApplyConventions:

protected override void ApplyConventions(ModelBuilder modelBuilder)
{
    base.ApplyConventions(modelBuilder);
    
    // Optional SQL Server conventions
    modelBuilder
        .UseDateTime2ForAllDateTimeProperties()
        .ConfigureDecimalPrecision(precision: 18, scale: 4);
}

Note: HoneyDrunkDbContext provides both ApplyConfigurations (for entity configurations) and ApplyConventions (for naming/type conventions). Use whichever is appropriate for your organization.

Azure SQL Support

Azure SQL Database and Azure SQL Managed Instance can use either AddHoneyDrunkDataSqlServer or AddHoneyDrunkDataAzureSql. The Azure SQL variant uses EF Core's UseAzureSql() method:

// Option 1: Standard SQL Server provider (works for Azure SQL)
services.AddHoneyDrunkDataSqlServer<MyDbContext>(sqlOptions =>
{
    sqlOptions.ConnectionString = configuration.GetConnectionString("AzureSql");
    sqlOptions.EnableRetryOnFailure = true;
    sqlOptions.MaxRetryCount = 5;  // Higher for Azure transient faults
    sqlOptions.CommandTimeoutSeconds = 60;
});

// Option 2: Azure SQL-specific provider
services.AddHoneyDrunkDataAzureSql<MyDbContext>(sqlOptions =>
{
    sqlOptions.ConnectionString = configuration.GetConnectionString("AzureSql");
    sqlOptions.EnableRetryOnFailure = true;
    sqlOptions.MaxRetryCount = 5;
});

Note: AddHoneyDrunkDataAzureSql uses EF Core's UseAzureSql() method which may have Azure-specific optimizations. Both methods support the same SqlServerDataOptions configuration. Choose based on your deployment target and EF Core version capabilities.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on HoneyDrunk.Data.SqlServer:

Package Downloads
HoneyDrunk.Data.Migrations

Migration tooling for HoneyDrunk.Data. Complete architecture overhaul with design-time DbContext factories and migration runner helpers for CI/CD scenarios. Not intended for runtime use.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0 100 2/15/2026
0.2.0 109 1/6/2026
0.1.0 682 12/1/2025

v0.3.0: Canary test coverage for CI invariant enforcement. No functional changes from v0.2.0.