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
<PackageReference Include="HoneyDrunk.Data.SqlServer" Version="0.3.0" />
<PackageVersion Include="HoneyDrunk.Data.SqlServer" Version="0.3.0" />
<PackageReference Include="HoneyDrunk.Data.SqlServer" />
paket add HoneyDrunk.Data.SqlServer --version 0.3.0
#r "nuget: HoneyDrunk.Data.SqlServer, 0.3.0"
#:package HoneyDrunk.Data.SqlServer@0.3.0
#addin nuget:?package=HoneyDrunk.Data.SqlServer&version=0.3.0
#tool nuget:?package=HoneyDrunk.Data.SqlServer&version=0.3.0
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 layerMicrosoft.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 | Versions 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. |
-
net10.0
- HoneyDrunk.Data.EntityFramework (>= 0.3.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 10.0.3)
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.
v0.3.0: Canary test coverage for CI invariant enforcement. No functional changes from v0.2.0.