pushinbr/pam-native-sync

Offline-first outbox, cursors, conflict resolution and incremental synchronization for PAM Native.

Maintainers

Package info

github.com/push-in/pam-native-sync

Type:pam-native-plugin

pkg:composer/pushinbr/pam-native-sync

Transparency log

Statistics

Installs: 14

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.1 2026-08-03 22:07 UTC

This package is auto-updated.

Last update: 2026-08-03 22:45:35 UTC


README

An offline-first synchronization engine, not a database wrapper. It adds an idempotent outbox, ordered batches, incremental cursors, tombstones, retry budgets and deterministic conflict policies above PAM Native SQLite and any transport implementation.

composer require pushinbr/pam-native-sync
$engine = new Pam\Native\Sync\SyncEngine(
    new Pam\Native\Sync\Storage\SQLiteSyncStore(),
    $transport,
    new Pam\Native\Sync\PolicyConflictResolver(Pam\Native\Sync\ConflictPolicy::LastWriteWins),
);
$engine->upsert('todos', 'todo-42', ['title' => 'Ship'], 7, fn ($operation) => null);
$engine->synchronize(fn (Pam\Native\Sync\SyncRunReport $report) => null);

SyncTransport is provider-neutral. HTTP, Realtime and Laravel adapters remain separate packages. SQLite writes are prepared and remote changes plus cursor advancement are committed in one native transaction. Server versions are monotonic and stale pulls cannot overwrite newer replicas.

Platform support: Android API 26+, iOS 15+, PAM Native 0.6.x.