Docs Client library reference Swift
v0.2.6-alpha.3Swift: Introduction
KizunaSyncClient is the typed Swift app client over the UniFFI engine in kizunasync-ffi, and the native peer of createKizunaSync in JavaScript. Reads answer from a local SQLite file, and writes land there first, wait in a durable outbox, and settle against Supabase on a sync run. Every method except from(_:) hops off the calling thread, so a call from the main actor never blocks the interface.
Version#
kizunasync-ffi 0.2.6-alpha.3 (Alpha). Swift package https://github.com/kizunasync/kizunasync-swift, product KizunaSync. See Installing.
What this reference covers#
- The shortest path through the client is Initializing, then the Host scheduler, which syncs after every write, then Insert data.
- Local reads and writes: Fetch data, Insert data, Update data, Delete data, Write with filters, Using filters, and Using transforms.
- Sync controls: Sync, Pull once, Push once, Set bucket, Checkpoint, Outbox depth, and Reset.
- The rest of the surface: Set access token, List rejections, Dismiss a rejection, List overwrites, Dismiss an overwrite, Subscribe to events, the attachment methods from Attach a file to Vacuum attachments, including Retry, Cancel, and Remove an attachment, the Host scheduler, Inspect and Inspector, Dispose, and Types.
- Swift has no hooks.
useQueryanduseSyncStatusbelong to the JavaScript bindings; a Swift app pairs Subscribe to events with Combine, and reads loop state fromhealth()/onHealthon Host scheduler.from(_:)is the fluent peer of JavaScriptkizunasync.from.
What Supabase covers#
| Concern | Use |
|---|---|
| Sign-in, sessions, and token refresh | signInWithPassword and refreshSession, then pass the token to Set access token |
| Row Level Security policies | Row Level Security, which judges every mutation a push carries |
| Realtime channels behind the wake-up doorbell | subscribe from the app, calling wake(reason:) on the Host scheduler |
| Storage objects outside the attachment path | upload |
Related reference#
Found a problem? Edit this page on GitHub