コンテンツにスキップ

Function: createSyncHandler()

このコンテンツはまだ日本語訳がありません。

createSyncHandler<S, TCtx>(options): (request) => Promise<Response>

Defined in: server/src/sync-handler.ts:357

Build a fetch-compatible handler that services /push and /pull under basePath (default /sync). Wire it into your Worker’s default export.

The push side is idempotent per (clientGroupID, clientID, mutation.id): a repeated push of the same mutation is dropped by the last_mutation_id check. A mutation that throws still advances the id (in a separate tx) so the client is never stuck in an infinite retry loop.

S extends Record<string, AnyTable>

TCtx

SyncHandlerOptions<S, TCtx>

(request) => Promise<Response>