Skip to content

Conversation

@simolus3
Copy link
Contributor

@simolus3 simolus3 commented Oct 23, 2025

This makes the Swift SDK compatible with changes from powersync-ja/powersync-kotlin#277 without adding encryption support right away.

We now depend on CSQLite to compile and link SQLite statically. That Swift package has a set of default package traits enabling modern SQLite features and recommended compile-time options. That includes passing SQLITE_THREADSAFE=0, which is not appropriate for PowerSync because we use SQLite across threads (just a connection is not used concurrently). It also passes OMIT_AUTOINIT, so we need to manually call sqlite3_initialize() before opening a database.

Note: The initial proposal for package traits suggests that passing traits on a package dependency overrides the set of default traits. At least with some poking in XCode compilation logs, that doesn't actually apear to be the case and we can't disable those traits in XCode builds (lol). Enabling the THREADSAFE_2 trait keeps the THREADSAFE_0 trait active, but due to the way CSQLite is set up, it happens to override the prior one.

@simolus3 simolus3 changed the title Prepare for Kotlin common module Update Kotlin SDK and core extension Oct 27, 2025
@simolus3 simolus3 marked this pull request as ready for review October 28, 2025 14:16
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