PostgresChangeApplier
Applies sync changes to PostgreSQL tables. Implements spec Section 11 (Bi-Directional Sync Protocol).
public static class PostgresChangeApplier
Methods
ApplyChange(NpgsqlConnection, SyncLogEntry, ILogger)
[SuppressMessage("Security", "CA2100:Review SQL queries for security vulnerabilities", Justification = "Table names come from sync log entries - validated at trigger generation")]
public static Result<bool, SyncError> ApplyChange(NpgsqlConnection connection, SyncLogEntry entry, ILogger logger)
Applies a single sync log entry to the database. Returns true on success, false on FK violation (to defer), error on other failures.
Parameters:
| Name | Type | Description |
|---|---|---|
connection |
NpgsqlConnection |
PostgreSQL connection. |
entry |
SyncLogEntry |
Sync log entry to apply. |
logger |
ILogger |
Logger for change application. |
Returns: SyncError> - True on success, false on FK violation, error on failure.