UmbrellaFrame.ModelSync.Core
1.4.0
See the version list below for details.
dotnet add package UmbrellaFrame.ModelSync.Core --version 1.4.0
NuGet\Install-Package UmbrellaFrame.ModelSync.Core -Version 1.4.0
<PackageReference Include="UmbrellaFrame.ModelSync.Core" Version="1.4.0" />
<PackageVersion Include="UmbrellaFrame.ModelSync.Core" Version="1.4.0" />
<PackageReference Include="UmbrellaFrame.ModelSync.Core" />
paket add UmbrellaFrame.ModelSync.Core --version 1.4.0
#r "nuget: UmbrellaFrame.ModelSync.Core, 1.4.0"
#:package UmbrellaFrame.ModelSync.Core@1.4.0
#addin nuget:?package=UmbrellaFrame.ModelSync.Core&version=1.4.0
#tool nuget:?package=UmbrellaFrame.ModelSync.Core&version=1.4.0
ModelSync
![]()
ModelSync is a schema and migration toolkit for .NET projects that want explicit database changes without adopting a full ORM. It generates provider-specific DDL from attributed C# models, compares models with live databases, runs ordered SQL migrations, synchronizes stored procedures, and produces deployment reports.
Current version: 1.4.0
What's New in 1.4.0
Version 1.4.0 makes migration failures observable, keeps repair suggestions separate from executable SQL, strengthens transaction/history reporting, and removes application-specific SQL Server schema defaults. Existing generator and migration API signatures remain available; review the migration guide before upgrading.
Choose A Workflow
| Goal | API |
|---|---|
| Generate table SQL from a model | TableGenerator |
| Compare models with a live database | ModelSynchronizer |
| Run ordered SQL files with history | MigrationRunner |
| Synchronize procedure files | StoredProcedureSynchronizer |
| Validate, preview, and run from CI | modelsync CLI |
Install
Install the provider you need. Core is included automatically.
dotnet add package UmbrellaFrame.ModelSync.SqlServer --version 1.4.0
dotnet add package UmbrellaFrame.ModelSync.MySql --version 1.4.0
dotnet add package UmbrellaFrame.ModelSync.PostgreSQL --version 1.4.0
dotnet add package UmbrellaFrame.ModelSync.SQLite --version 1.4.0
dotnet add package UmbrellaFrame.ModelSync.Oracle --version 1.4.0
dotnet add package UmbrellaFrame.ModelSync.Analyzers --version 1.4.0
UmbrellaFrame.ModelSync.Oracle is publicly available as a preview provider for table DDL and partial safe model synchronization. Its migration runner, routine synchronization, reset, and native lock features are not production-ready.
Quick Start
using UmbrellaFrame.ModelSync.Core;
using UmbrellaFrame.ModelSync.SqlServer;
[SqlServerTableName("Products")]
public sealed class Product
{
[SqlServerColumnType(SqlServerColumnType.INT)]
[SqlServerColumnPrimaryKey(isAutoIncrement: true)]
public int Id { get; set; }
[SqlServerColumnType(SqlServerColumnType.NVARCHAR, "200")]
[SqlServerColumnNotNull]
[DbColumnIndex("IX_Products_Name")]
public string Name { get; set; } = string.Empty;
}
var generator = new SqlServerTableGenerator(connectionString);
var sql = generator.GenerateSqlServerTable<Product>(ifNotExists: true);
Console.WriteLine(sql);
await generator.CreateTablesAsync();
Generate first, inspect the SQL, then execute. Destructive methods require explicit approval:
var allow = DestructiveOperationOptions.Allow();
generator.DropColumn<Product>("LegacyCode", allow);
generator.AlterColumnType<Product>("Price", allow);
await generator.DropTablesAsync(allow);
Live Model Comparison
var options = new SqlServerModelSyncOptions
{
ConnectionString = connectionString,
DefaultSchema = "app",
HistorySchema = "sec"
};
var result = await SqlServerModelSynchronizer
.FromAssemblies(options, typeof(Product).Assembly)
.CompareAsync(cancellationToken);
// Review AutomaticOperations, ManualOperations, SkippedOperations,
// and BlockedOperations before applying.
await result.ApplyAsync(cancellationToken);
Safe additive operations can be automatic. Drop, rename, narrowing, and risky nullability changes are reported instead of silently executed.
Ordered Migrations
var runner = new SqlServerMigrationRunner(connectionString);
runner.RegisterScriptFile("Database/Scripts/Tables/001_CreateProducts.sql");
runner.RegisterScriptFile("Database/Scripts/StoredProcedures/010_GetProducts.sql");
runner.RegisterScriptFile("Database/Scripts/Seeds/020_DefaultProducts.sql");
var plan = await runner.CompareRegisteredAsync(cancellationToken); // read-only
var result = await runner.RunWithResultAsync(cancellationToken);
Scripts run in this order:
Tables -> StoredProcedures -> Triggers -> Seeds -> CustomSql
History rows and SQL hashes make repeat runs predictable. Registered SQL files are trusted project artifacts; do not build them from user input.
CLI And Reports
The CLI supports sqlserver, mysql, mariadb, postgresql, and sqlite. Oracle is intentionally unavailable in the CLI while its migration runner remains preview-only.
dotnet tool install --global UmbrellaFrame.ModelSync.Cli --version 1.4.0
Pass secrets through an environment variable instead of a process argument:
export MODELSYNC_CONNECTION_STRING='Data Source=modelsync-preview.db'
modelsync validate --scripts ./Database/Scripts
modelsync run \
--provider sqlite \
--connection-env MODELSYNC_CONNECTION_STRING \
--scripts ./Database/Scripts \
--dry-run
modelsync run \
--provider sqlite \
--connection-env MODELSYNC_CONNECTION_STRING \
--scripts ./Database/Scripts \
--apply \
--report-md ./artifacts/modelsync-report.md \
--report-json ./artifacts/modelsync-report.json
--apply is required for mutation. Ctrl+C is forwarded to the migration operation. The inline --connection option is retained for compatibility but may be visible in process listings.
Safety Notes
- ModelSync is not an ORM and does not provide entity tracking, LINQ, or runtime CRUD.
- Compare APIs are read-only; infrastructure is created by explicit mutation APIs.
DbColumnDefault,DbColumnCheck, and migration scripts contain reviewed SQL and must not use untrusted input.- Prefer a deployment-time migration job. If startup migration is unavoidable, keep provider-native locking enabled.
- Database reset requires explicit destructive approval, an expected database name, environment validation, and system-database protection.
- Run database reset from a single deployment/local runner; do not start multiple application instances with reset enabled.
- SQL Server can optionally back up a database before reset.
Provider Snapshot
| Feature | SQL Server | MySQL/MariaDB | PostgreSQL | SQLite | Oracle preview |
|---|---|---|---|---|---|
| Table DDL | Yes | Yes | Yes | Yes | Yes |
| Safe model sync | Yes | Yes | Yes | Yes | Partial |
| Migration runner | Yes | Yes | Yes | Yes | No |
| Stored procedures | Yes | Yes | Yes | No | No |
| Native migration lock | Yes | Yes | Yes | Write lock | No |
Documentation
- Full usage guide
- Türkçe tam kullanım kılavuzu
- Provider support matrix
- Migration runner
- CLI and reporting
- 1.4.0 release notes
MIT © UmbrellaFrame
| 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
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on UmbrellaFrame.ModelSync.Core:
| Package | Downloads |
|---|---|
|
UmbrellaFrame.ModelSync.PostgreSQL
PostgreSQL provider for UmbrellaFrame.ModelSync - attribute-based schema generator. |
|
|
UmbrellaFrame.ModelSync.MySql
MySQL provider for UmbrellaFrame.ModelSync - attribute-based schema generator. |
|
|
UmbrellaFrame.ModelSync.SqlServer
SQL Server provider for UmbrellaFrame.ModelSync - attribute-based schema generator. |
|
|
UmbrellaFrame.ModelSync.SQLite
SQLite provider for UmbrellaFrame.ModelSync - attribute-based schema generator. |
|
|
UmbrellaFrame.ModelSync.Oracle
Oracle provider for UmbrellaFrame.ModelSync - attribute-based schema generator. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.5.1 | 332 | 8/9/2026 |
| 1.5.0 | 287 | 8/9/2026 |
| 1.4.0 | 356 | 7/18/2026 |
| 1.4.0-rc.1 | 110 | 7/18/2026 |
| 1.3.0 | 319 | 7/15/2026 |
| 1.2.3 | 306 | 7/11/2026 |
| 1.2.2 | 320 | 7/1/2026 |
| 1.2.0 | 320 | 6/29/2026 |
| 1.1.0 | 304 | 6/29/2026 |
| 1.0.8 | 292 | 6/28/2026 |
| 1.0.7 | 296 | 6/24/2026 |
| 1.0.5 | 298 | 6/19/2026 |
| 1.0.4 | 319 | 5/22/2026 |
| 1.0.2 | 291 | 5/14/2026 |
ModelSync 1.4.0 hardens migration failure reporting, repair/history integrity, transaction states, and dry-run accuracy.