DATE:
AUTHOR:
PowerSync Product Team
Swift SDK

Swift SDK 1.14.0: now pure Swift

DATE:
AUTHOR: PowerSync Product Team

For this release, we've re-implemented the Swift SDK in pure Swift (it was based on a binary XCFramework of our Kotlin SDK in previous versions). This improves performance, makes future platform integrations simpler, and allows you to debug and explore our SDK sources in XCode.

The public API does not have breaking changes, but we've rewritten how the SDK handles SQLite under the hood, so we encourage testing your app, queries and sync after upgrading.

Background

We originally built the Swift SDK on top of Kotlin Multiplatform, bridged to Swift via SKIE and KMMBridge. We wrote about that early design in Using KMP with KMMBridge and SKIE and about our progress through alpha and stable in Building a Swift SDK with SKIE. This approach got us shipping a Swift SDK fast and validating usage early. While we made the DX more Swift-friendly over later releases, costs persisted. Apps bundled the entire Kotlin standard library, adding to binary size. And there was the maintenance burden: every Swift release required publishing a Kotlin XCFramework first, plus keeping the Swift adapter code in sync with it.

We built every PowerSync client SDK on the same Rust core: powersync-sqlite-core. It implements the sync protocol and SQLite extension logic once. Each SDK is the language-specific layer over it. In Swift, that core has been doing the heavy lifting since version 1.8.0, when we made our more performant Rust-based sync client the default. By v1.13, we had narrowed the Kotlin layer down to four pieces: SQLite connection management, the streaming sync client, CRUD handling, and schema serialization. That was small enough to rewrite in Swift, and version 1.14 ships this rewrite.

What's new

Architecture

  • The PowerSync Kotlin XCFramework dependency was removed from Package.swift.

  • The SQLite connection pool, sync client driver, schema serializer, and CRUD layer are now Swift-native.

Public API

  • CrudEntry has two new typed fields: opDataTyped and previousValuesTyped (both JsonParam?). Use them to upload column values with their SQLite types preserved instead of stringified. The old opData and previousValues properties still work; they're now computed accessors that coerce typed values to strings.

  • CrudBatch, CrudEntry, and CrudTransaction are concrete structs now, not protocols. Reading their properties still works. You can't construct them in your own code anymore (in tests or mocks, for example); they're SDK-owned types.

Upgrading

Upgrading is generally just a Package.swift version bump, but note the following:

  • The SQLite connection pool logic is a full rewrite. Smoke-test queries after upgrading.

  • newClientImplementation on ConnectOptions is now a no-op. The Kotlin client is gone, so setting it to false does nothing. We kept the flag for backwards compatibility.

Feedback and help

Questions or issues about this update? Chat to us on Discord or open an issue on GitHub.

Powered by LaunchNotes