DbReactor.Core
1.1.2
dotnet add package DbReactor.Core --version 1.1.2
NuGet\Install-Package DbReactor.Core -Version 1.1.2
<PackageReference Include="DbReactor.Core" Version="1.1.2" />
<PackageVersion Include="DbReactor.Core" Version="1.1.2" />
<PackageReference Include="DbReactor.Core" />
paket add DbReactor.Core --version 1.1.2
#r "nuget: DbReactor.Core, 1.1.2"
#:package DbReactor.Core@1.1.2
#addin nuget:?package=DbReactor.Core&version=1.1.2
#tool nuget:?package=DbReactor.Core&version=1.1.2
DbReactor - .NET Database Migration Framework
DbReactor is a powerful, extensible .NET database migration framework that provides version-controlled, repeatable database schema management. It supports multiple script types, database providers, and offers comprehensive tracking and rollback capabilities.
Packages
DbReactor is split into separate NuGet packages:
Core Framework
- DbReactor.Core - Core migration framework and abstractions
- Documentation | Quick Start
dotnet add package DbReactor.Core
Database Providers
- DbReactor.MSSqlServer - SQL Server implementation
- Documentation | Quick Start
dotnet add package DbReactor.MSSqlServer
More database providers coming soon...
Table of Contents
- Quick Start - Get running in 5 minutes
- Features - Key capabilities
- Architecture - How it works
- Package Documentation - Detailed guides
- Examples - Sample projects
- Support - Help and resources
Features
- Multiple Script Types: SQL scripts, dynamic C# code scripts, and embedded resources
- Database Agnostic: Extensible architecture supports any database platform
- Comprehensive Tracking: Full migration history with execution time and rollback support
- Dry Run Mode: Preview what migrations would be executed without actually running them
- Safe Migrations: Built-in SQL injection protection and transaction management
- Flexible Discovery: Multiple ways to organize and discover migration scripts
- Async-First Architecture: Non-blocking database operations with cancellation tokens and sync wrappers (including DatabaseProvisioner)
- Robust Error Handling: Detailed exception hierarchy with contextual information
- Production Ready: Enterprise-grade security and performance optimizations
Quick Start
Choose your database provider to get started:
- SQL Server: DbReactor.MSSqlServer Quick Start
- Core Framework: DbReactor.Core Quick Start
5-Minute Setup
# Install packages
dotnet add package DbReactor.Core
dotnet add package DbReactor.MSSqlServer
using DbReactor.MSSqlServer.Extensions;
var config = new DbReactorConfiguration()
.UseSqlServer(connectionString)
.UseStandardFolderStructure(typeof(Program).Assembly)
.UseConsoleLogging()
.CreateDatabaseIfNotExists();
var engine = new DbReactorEngine(config);
var result = await engine.RunAsync();
That's it! See the quick start guides for detailed setup instructions.
Architecture
DbReactor uses a modular architecture with clear separation of concerns:
Core Framework (DbReactor.Core
)
- Migration Engine: Orchestrates migration execution
- Configuration Management: Centralized configuration system
- Script Discovery: Finds and orders migration scripts
- Abstractions: Database-agnostic interfaces
Database Providers
- Connection Management: Database-specific connection handling
- Script Execution: Database-specific SQL execution
- Migration Journaling: Tracks executed migrations
- Database Provisioning: Creates databases if needed
Key Interfaces
// Database provider interfaces
IConnectionManager // Database connections
IScriptExecutor // Script execution
IMigrationJournal // Migration tracking
IDatabaseProvisioner // Database creation
// Core interfaces
IScriptProvider // Script discovery
ILogProvider // Logging
ICodeScript // C# migration scripts
Package Documentation
Core Framework
- DbReactor.Core - Core abstractions and engine
- DbReactor.Core Quick Start - Get started in 5 minutes
Database Providers
- DbReactor.MSSqlServer - Complete SQL Server implementation
- DbReactor.MSSqlServer Quick Start - SQL Server setup guide
Examples
Basic SQL Server Migration
// Program.cs
var config = new DbReactorConfiguration()
.UseSqlServer("Server=localhost;Database=MyApp;Trusted_Connection=true;")
.UseStandardFolderStructure(typeof(Program).Assembly)
.UseConsoleLogging();
var engine = new DbReactorEngine(config);
await engine.RunAsync();
Migration Files
Scripts/
├── upgrades/
│ ├── M001_CreateUsersTable.sql
│ ├── M002_SeedUsers.cs
│ └── M003_CreateIndexes.sql
└── downgrades/
├── M001_CreateUsersTable.sql
├── M002_SeedUsers.sql
└── M003_CreateIndexes.sql
Sample Projects
- DbReactor.RunTest - Complete working example
- More examples in package documentation
Creating Database Providers
DbReactor is designed to be extensible. Create custom database providers by implementing the core interfaces:
public static class MyDatabaseExtensions
{
public static DbReactorConfiguration UseMyDatabase(this DbReactorConfiguration config, string connectionString)
{
return config
.UseConnectionManager(new MyConnectionManager(connectionString))
.UseScriptExecutor(new MyScriptExecutor())
.UseMigrationJournal(new MyMigrationJournal())
.UseDatabaseProvisioner(new MyDatabaseProvisioner());
}
}
Roadmap
Upcoming Database Providers
- DbReactor.PostgreSQL - PostgreSQL support
- DbReactor.MySQL - MySQL support
- DbReactor.SQLite - SQLite support
- DbReactor.Oracle - Oracle support
Planned Features
- Migration rollback improvements
- Schema comparison tools
- Migration performance analytics
- Multi-database support
- Cloud database provider integrations
Support
- Package Documentation: See individual package READMEs for detailed guides
- Quick Start Guides: Step-by-step setup instructions
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Contributing
We welcome contributions! See CONTRIBUTING.md for guidelines.
License
[Your License Here]
Ready to get started? Choose your database provider and follow the quick start guide!
Product | Versions 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. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DbReactor.Core:
Package | Downloads |
---|---|
DbReactor.MSSqlServer
SQL Server database provider for DbReactor .NET database migration system. Provides complete SQL Server support including connection management, script execution, and migration journaling. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release of DbReactor.Core migration framework