DataCrud.DBOps.SqlServer 1.0.2

dotnet add package DataCrud.DBOps.SqlServer --version 1.0.2
                    
NuGet\Install-Package DataCrud.DBOps.SqlServer -Version 1.0.2
                    
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="DataCrud.DBOps.SqlServer" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DataCrud.DBOps.SqlServer" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="DataCrud.DBOps.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 DataCrud.DBOps.SqlServer --version 1.0.2
                    
#r "nuget: DataCrud.DBOps.SqlServer, 1.0.2"
                    
#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 DataCrud.DBOps.SqlServer@1.0.2
                    
#: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=DataCrud.DBOps.SqlServer&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=DataCrud.DBOps.SqlServer&version=1.0.2
                    
Install as a Cake Tool

DataCrud.DBOps

NuGet Version License: MIT .NET

DataCrud.DBOps is a premium, high-performance database maintenance and job orchestration library for .NET. Designed to bridge the gap between modern cloud-native architectures and legacy enterprise systems, it provides a unified interface for database backups, index optimization, and real-time operational monitoring.


✨ Key Features

  • ⚡ Intelligent Maintenance: Automated database shrinking and sophisticated index management (Reorganize/Rebuild) to ensure peak performance.
  • 🛡️ Resilient Backups: Automated full-database backup workflows with high-ratio compression and integrity verification.
  • ☁️ Multi-Cloud Sync: Native, high-performance integration with AWS S3 and Azure Blob Storage for off-site redundancy.
  • 📊 Embedded Dashboard: A stunning, lightweight operational dashboard built with HTMX and Alpine.js, providing real-time job control and log visibility.
  • 📝 Centralized Logging: Robust IJobStorage architecture supporting SQL Server and LiteDB, featuring parent/child log relationships for granular auditing.
  • 🚀 Cross-Platform Heritage: First-class support for ASP.NET Core (DI-friendly) and Legacy .NET Framework (OWIN/Console).

🏗️ Architecture: Centralized History

Unlike traditional maintenance scripts, DBOps utilizes a centralized orchestration engine. All database providers report to a unified IJobStorage backend, ensuring that your maintenance history is consistent across all servers.

  • Parent Logs: Summary of job type, execution status, and duration.
  • Child Logs: Detailed execution traces, warnings, and error stack traces for every step of the process.

🛠 Supported Ecosystem

Category Supported Providers NuGet Status
Databases SQL Server, PostgreSQL, MySQL, Oracle, MongoDB SqlServer Postgres MySql
Cloud Storage AWS S3, Azure Blob Storage AwsPush AzurePush
Target Frameworks .NET 9.0, .NET Standard 2.0, .NET Framework 4.7+ Frameworks
Core Components Core Engine, Middleware, Backup, Maintenance Core AspNetCore Backup

💻 Getting Started

1. Modern .NET (ASP.NET Core)

Install the core and your preferred provider via NuGet:

dotnet add package DataCrud.DBOps.AspNetCore
dotnet add package DataCrud.DBOps.SqlServer

Configure with Dependency Injection:

builder.Services.AddDBOps(options =>
{
    // Configure Storage (Centralized History)
    options.Storage = new SqlServerJobStorage("YourHistoryDbConnectionString");
    
    // Multi-Cloud Sync
    options.PushToAws = true;
    options.AwsBucketName = "bucket-name";
    options.AwsRegion = "us-east-1";
});

2. Multi-Database Configuration

DBOps is designed to manage multiple database instances (and different providers) simultaneously from a single dashboard.

builder.Services.AddDBOps(options =>
{
    options.Storage = new LiteDbJobStorage("history.db");

    // --- Zipping Configuration ---
    options.EnableZipping = true; // Set false to skip compression (default: true)
    options.BackupPath = "C:\\Backups"; // Custom local staging directory

    // --- Azure Storage Configuration ---
    // Backups will be pushed to the 'backups' container in 'databases/' folder
    options.PushToAzure = true;
    options.AzureStorageConnectionString = "DefaultEndpointsProtocol=https;AccountName=...";

    // --- AWS S3 Configuration ---
    options.PushToAws = true;
    options.AwsAccessKey = "YOUR-ACCESS-KEY";
    options.AwsSecretKey = "YOUR-SECRET-KEY";
    options.AwsBucketName = "your-bucket-name";
    options.AwsRegion = "us-east-1";

    // --- Multi-Server Registration ---
    options.Providers.Add(new SqlServerProvider("ConnString1", "Production ERP"));
    options.Providers.Add(new PostgresProvider("PostgresConn", "Analytics App"));

    // Enable "Discovery Mode" to automatically find all DBs on a server
    options.Providers.Add(new SqlServerProvider("ServerConn", "Main Cluster", discover: true));
});

2. .NET Framework / Legacy (OWIN)

For legacy applications, install the AspNet integration:

Install-Package DataCrud.DBOps.AspNet

Configure in your Startup.cs:

public void Configuration(IAppBuilder app)
{
    app.UseDBOps(options => 
    {
        options.DashboardPath = "/dbops";
        options.Storage = new LiteDbJobStorage("jobs_dbops.db");
        
        // Register your database providers
        options.Providers.Add(new SqlServerProvider("YourConnectionString", "Data Server 01"));
    });
}

2. Embedded Dashboard

Access the premium dashboard by mapping the middleware in your startup:

app.UseDatabaseOpsDashboard(options => 
{
    options.Path = "/dbops";
    options.Security.RequireAdminRole = true;
});

🔒 Security & Authentication

DBOps is secure by default. You can configure authentication for the dashboard using several methods:

1. Basic Authentication

The simplest way to protect your dashboard is using the built-in Basic Auth.

options.Security.Enabled = true; // Enabled by default
options.Security.Username = "admin";
options.Security.Password = "strong-password-here";

2. Role-Based Authorization

If your application uses ASP.NET Identity or OWIN Security, you can restrict access to specific roles:

options.Security.AllowedRoles = new[] { "Administrator", "DBManager" };

3. Custom Authorization Filters

For advanced security requirements (IP filtering, custom headers, etc.), implement IDBOpsAuthorizationFilter:

options.Security.AuthorizationFilters.Add(new MyCustomAuthFilter());

3. Scheduling & Background Jobs

You can easily automate your database maintenance using popular schedulers like Hangfire or native .NET Background Services.

Using Hangfire
// In your Startup or Program.cs
RecurringJob.AddOrUpdate<MaintenanceManager>(
    "daily-backup",
    manager => manager.RunAsync("MyDatabase", true, true, true, true, true, "C:\\Backups", 7, true, null, default),
    Cron.Daily
);
Using .NET BackgroundService
public class DatabaseBackupWorker : BackgroundService
{
    private readonly IServiceProvider _serviceProvider;

    public DatabaseBackupWorker(IServiceProvider serviceProvider)
    {
        _serviceProvider = serviceProvider;
    }

    protected override async Task ExecuteAsync(CancellationToken stoppingToken)
    {
        while (!stoppingToken.IsCancellationRequested)
        {
            using (var scope = _serviceProvider.CreateScope())
            {
                var manager = scope.ServiceProvider.GetRequiredService<MaintenanceManager>();
                await manager.RunAsync("MyDatabase", backup: true, shrink: true, index: true, 
                                     reorganize: true, cleanup: true, backupDir: "C:\\Backups");
            }
            
            // Wait 24 hours
            await Task.Delay(TimeSpan.FromHours(24), stoppingToken);
        }
    }
}

📜 Professional Services & Support

DataCrud.DBOps is maintained for enterprise-grade stability. For custom provider development or specialized cloud integrations, please reach out to the DataCrud team.


📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 97 4/17/2026
1.0.1 106 4/17/2026
1.0.0 91 4/17/2026