PowerSync is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres, MongoDB or MySQL on the server-side.
This is the PowerSync SDK for Swift clients. The SDK reference is available here, API references are documented here.
-
- This is the Swift SDK implementation.
The easiest way to test the PowerSync Swift SDK is to run our demo application.
- Demo/PowerSyncExample: A simple to-do list application demonstrating the use of the PowerSync Swift SDK using a Supabase connector.
Add
dependencies: [
...
.package(url: "https://github.com/powersync-ja/powersync-swift", from: "1.0.0")
],
targets: [
.target(
name: "YourTargetName",
dependencies: [
...
.product(
name: "PowerSync",
package: "powersync-swift"
),
]
)
]
to your Package.swift
file.
Create a PowerSync client
import PowerSync
let powersync = PowerSyncDatabase(
schema: Schema(
tables: [
Table(
name: "users",
columns: [
.text("count"),
.integer("is_active"),
.real("weight"),
.text("description")
]
)
]
),
logger: DefaultLogger(minSeverity: .debug)
)
The PowerSync Swift SDK makes use of the PowerSync Kotlin Multiplatform SDK and the API tool SKIE under the hood to implement the Swift package. However, this dependency is resolved internally and all public APIs are written entirely in Swift.
For more details, see the Swift SDK reference and generated API references.
See the attachments README for more information.