See the Azure Devops CI : https://dev.azure.com/dotmim/Dotmim.Sync
Release version 0.2.1 and pre-release 0.3.0 are hosted on nuget.org : https://www.nuget.org/packages?q=dotmim.sync
DotMim.Sync is a straightforward SDK for syncing relational databases, developed on top of .Net Standard 2.0, available and ready to use within IOT, Xamarin, .NET, UWP and so on :)
The full documentation is available here : https://mimetis.github.io/Dotmim.Sync/
Multi Databases | Cross Plaform | .Net Standard 2.0 |
---|---|---|
Here are the easiest way to be able to make a simple sync :
- Create a .Net Core 2.0 or .Net Fx 4.6 console application.
- Add the nugets packages DotMim.Sync.SqlServer and DotMim.Sync.Sqlite
- Add this code :
// Sql Server provider, the master.
SqlSyncProvider serverProvider = new SqlSyncProvider(
@"Data Source=.;Initial Catalog=AdventureWorks;Integrated Security=true;");
// Sqlite Client provider for a Sql Server <=> Sqlite sync
SqliteSyncProvider clientProvider = new SqliteSyncProvider("advworks.db");
// Tables involved in the sync process:
var tables = new string[] {"ProductCategory",
"ProductDescription", "ProductModel",
"Product", "ProductModelProductDescription",
"Address", "Customer", "CustomerAddress",
"SalesOrderHeader", "SalesOrderDetail" };
// Sync orchestrator
SyncAgent agent = new SyncAgent(clientProvider, serverProvider, tables);
do
{
var s = await agent.SynchronizeAsync();
Console.WriteLine($"Total Changes downloaded : {s.TotalChangesDownloaded}");
} while (Console.ReadKey().Key != ConsoleKey.Escape);
If you don't have any databases ready for testing, use this one : AdventureWorks lightweight script for SQL Server
The script is ready to execute in SQL Server. It contains :
- A lightweight AdvenureWorks database, acting as the Server database (called AdventureWorks)
- An empty database, acting as the Client database (called Client)
- install VS 2017
- install Microsoft SQL Server (localdb is sufficient)
- install MySQL (run installMySql.ps1 which automates this using chocolatey)
- open "SQLUtils.HelperDB" and modify the connection strings to suit your configuration
- Check the full documentation, available here : https://mimetis.github.io/Dotmim.Sync/
- Feel free to ping me: @sebpertus