PowerSchemaSync 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package PowerSchemaSync --version 1.0.0                
NuGet\Install-Package PowerSchemaSync -Version 1.0.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="PowerSchemaSync" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PowerSchemaSync --version 1.0.0                
#r "nuget: PowerSchemaSync, 1.0.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.
// Install PowerSchemaSync as a Cake Addin
#addin nuget:?package=PowerSchemaSync&version=1.0.0

// Install PowerSchemaSync as a Cake Tool
#tool nuget:?package=PowerSchemaSync&version=1.0.0                

power-schema-sync

Nuget

Compare database structures and generate SQL for structure synchronization

Quick Start

IDataBase dbSoruce = DataBaseFactory.GetDataBase(DataBaseType.MYSQL, "connString1");
IDataBase dbTarget = DataBaseFactory.GetDataBase(DataBaseType.MYSQL, "connString2");

// 1.获取整个库的表结构创建sql
var sqlStructure = dbSoruce.ExportStructure("test");
Console.WriteLine(sqlStructure);

// 2.结构比较获取同步结构的sql
var diff = new DiffUtility(dbSoruce, "test", dbTarget, "test").Diff();

Console.WriteLine("------------需要新建的表-----------");
foreach (var sqls in diff.CreateTables.Select(x => x.SyncSqls))
{
    foreach (var sql in sqls)
    {
        Console.WriteLine(sql);
    }
}

Console.WriteLine("------------需要删除的表-----------");
foreach (var sqls in diff.DeleteTables.Select(x => x.SyncSqls))
{
    foreach (var sql in sqls)
    {
        Console.WriteLine(sql);
    }
}

Console.WriteLine("------------需要修改的字段或索引-----------");
foreach (var sqls in diff.EditTables.Select(x => x.SyncSqls))
{
    foreach (var sql in sqls)
    {
        Console.WriteLine(sql);
    }
}

Console.ReadLine();

Features

  • table sync
  • column ysnc
  • index ysnc
  • primary ysnc
  • view ysnc
  • func sync
  • stored procedure sync

Supported Databases

  • Mysql
  • MS SqlServer
  • Orecle
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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. 
.NET Framework net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 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.2.1 617 7/31/2023
1.1.0 613 7/28/2023
1.0.0 589 7/22/2023