Skip to content

Implement CRUD transactions in Swift instead of Kotlin#127

Merged
simolus3 merged 7 commits intomainfrom
swiftify-crud-transactions
Apr 27, 2026
Merged

Implement CRUD transactions in Swift instead of Kotlin#127
simolus3 merged 7 commits intomainfrom
swiftify-crud-transactions

Conversation

@simolus3
Copy link
Copy Markdown
Contributor

Methods returning items from ps_crud (getCrudBatch(), getCrudTransactions() and getNextCrudTransaction()) don't do anything special: They read some items from ps_crud via getAll, marking a batch as completed removes the crud items and updates a target write checkpoint in the $local bucket. They don't need any integration with database internals.

So, implementing these methods in Swift is an easy first step towards eventually removing the Kotlin framework. This also allows us to provide typed values for opData and previousValues, previously they both had to be a [String: String?] map due to interop limitations.

@simolus3 simolus3 marked this pull request as ready for review April 15, 2026 08:42
@simolus3 simolus3 mentioned this pull request Apr 16, 2026
8 tasks
@simolus3 simolus3 requested a review from stevensJourney April 20, 2026 12:36
Copy link
Copy Markdown
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

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

I'm generally happy with these changes. The typed crud entries are a very nice addition. I left some minor comments for some items that caught my eye.

Comment thread Sources/PowerSync/Protocol/db/CrudBatch.swift Outdated
Comment thread Sources/PowerSync/Protocol/db/CrudEntry.swift Outdated
Comment thread Sources/PowerSync/Protocol/db/CrudEntry.swift Outdated
Comment thread Sources/PowerSync/Protocol/db/CrudBatch.swift
@simolus3 simolus3 requested a review from stevensJourney April 27, 2026 07:07
@simolus3 simolus3 merged commit 28ae63f into main Apr 27, 2026
3 checks passed
@simolus3 simolus3 deleted the swiftify-crud-transactions branch April 27, 2026 11:49
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