Skip to content

Latest commit

 

History

History
98 lines (68 loc) · 4.23 KB

Readme.md

File metadata and controls

98 lines (68 loc) · 4.23 KB

DMS

Build Status Documentation Status

See the Azure Devops CI : https://dev.azure.com/dotmim/Dotmim.Sync

Sources

Release and pre-release are hosted on nuget.org : https://www.nuget.org/packages?q=dotmim.sync

Documentation

Read the full documentation on https://dotmimsync.readthedocs.io/

Dotmim.Sync

DotMim.Sync (DMS) is a straightforward framework 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 :)

Multi Databases Cross Plaform .Net Standard 2.0

TL;DR;

Here is the easiest way to create a first sync, from scratch :

// Sql Server provider, the "server" or "hub".
SqlSyncProvider serverProvider = new SqlSyncProvider(
    @"Data Source=.;Initial Catalog=AdventureWorks;Integrated Security=true;");

// Sqlite Client provider acting as the "client"
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 agent
SyncAgent agent = new SyncAgent(clientProvider, serverProvider, tables);

do
{
    var result = await agent.SynchronizeAsync();
    Console.WriteLine(result);

} while (Console.ReadKey().Key != ConsoleKey.Escape);

And here is the result you should have, after a few seconds:

Synchronization done.
        Total changes  uploaded: 0
        Total changes  downloaded: 2752
        Total changes  applied: 2752
        Total resolved conflicts: 0
        Total duration :0:0:3.776

You're done !

Now try to update a row in your client or server database, then hit enter again.
You should see something like that:

Synchronization done.
        Total changes  uploaded: 0
        Total changes  downloaded: 1
        Total changes  applied: 1
        Total resolved conflicts: 0
        Total duration :0:0:0.045

Yes it's blazing fast !

Build from source and run the tests

  • To build this repository, just run dotnet build

  • then start up the MSSQL and MySQL databases required for the integration tests using docker-compose up (or docker-compose up -d in case you want it to run in the background)

  • finally run dotnet test -v n where -v n means "verbosity n[ormal]". Otherwise it would be m[inimal] and the console won't show any output

It won't get any easyer ;-)

Need Help