SyncHelpers

Classes > Sync.Http > SyncHelpers

Helper methods for sync database operations. Static methods that work with both SQLite and PostgreSQL.

public static class SyncHelpers

Methods

FetchChanges(string, string, long, int, ILogger)

public static List<SyncLogEntry> FetchChanges(string connectionString, string dbType, long fromVersion, int batchSize, ILogger logger)

Fetches changes from the sync log for the specified database type.

Parameters:

Name Type Description
connectionString String
dbType String
fromVersion Int64
batchSize Int32
logger ILogger

Returns: SyncLogEntry>

ApplyChanges(string, string, List<SyncLogEntryDto>, string, ILogger)

public static int ApplyChanges(string connectionString, string dbType, List<SyncLogEntryDto> changes, string originId, ILogger logger)

Applies changes to the database for the specified database type.

Parameters:

Name Type Description
connectionString String
dbType String
changes SyncLogEntryDto>
originId String
logger ILogger

Returns: Int32

UpsertClient(string, string, SyncClient, ILogger)

public static bool UpsertClient(string connectionString, string dbType, SyncClient client, ILogger logger)

Upserts a sync client for the specified database type.

Parameters:

Name Type Description
connectionString String
dbType String
client SyncClient
logger ILogger

Returns: Boolean

GetMaxVersion(string, string, ILogger)

public static long GetMaxVersion(string connectionString, string dbType, ILogger logger)

Gets the maximum sync version for the specified database type.

Parameters:

Name Type Description
connectionString String
dbType String
logger ILogger

Returns: Int64