Skip to content

Document typed CRUD values in Swift SDK#412

Open
mintlify[bot] wants to merge 1 commit intomainfrom
mintlify/swift-crud-typed-1777290700
Open

Document typed CRUD values in Swift SDK#412
mintlify[bot] wants to merge 1 commit intomainfrom
mintlify/swift-crud-typed-1777290700

Conversation

@mintlify
Copy link
Copy Markdown
Contributor

@mintlify mintlify Bot commented Apr 27, 2026

Summary

Documents the typed CRUD upload APIs introduced in the Swift SDK 1.14.0 release.

The triggering Swift SDK PR (powersync-ja/powersync-swift#127) reimplemented CRUD transactions natively in Swift. As a result:

  • CrudBatch, CrudEntry, and CrudTransaction are now concrete structs instead of protocols. They cannot be constructed in user code, but reading their properties is unchanged.
  • New properties opDataTyped and previousValuesTyped on CrudEntry expose the changed/previous column values as a typed JsonParam ([String: JsonValue]), preserving SQLite types instead of stringifying everything.
  • The legacy opData and previousValues properties remain available for backwards compatibility and now derive from the typed versions.

Changes

  • client-sdks/reference/swift.mdx: Added an "Uploading client changes" section covering getCrudBatch, getNextCrudTransaction, and getCrudTransactions, plus a property table for CrudEntry documenting the new typed values and the recommended migration path.
  • client-sdks/usage-examples.mdx: Updated the Swift uploadData snippet to use opDataTyped and the simplified complete() overload.

Reviewers

cc @benitav @simolus3

Generated-By: mintlify-agent
override func uploadData(database: PowerSyncDatabaseProtocol) async throws {
let batch = try await database.getCrudBatch()
guard let batch = batch else { return }
guard let batch = try await database.getCrudBatch() else { return }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this snippet are nice, IMO we should revert the reference/swift.mdx changes though (we have the "Writing Client Changes" page for that).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, agreed - will polish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants