- DATE:
- AUTHOR:
- PowerSync Product Team
PowerSync Swift SDK: v1.1.0
We are excited to announce the Version 1.1.0 release of the PowerSync Swift client SDK
NOTE: This release contains multiple breaking changes which were implemented to enhance the Swift developer experience. See the changelog for details.
Visit the full SDK reference to get started, for implementation details, and code snippets.
See the full changelog below.
Have any questions or feedback? Chat with us and the PowerSync community on Discord.
Changelog
1.1.0
[ADDED] Report real-time progress information about downloads through
SyncStatus.downloadProgress.
[ADDED] Exposed new table options allowing for more granular control over update tracking and metadata.
trackPreviousValues
: PopulatesCrudEntry.previousValues
, so you can see both the old and new values during an update.trackMetadata
: Adds a_metadata
column to the table. Use this to store any custom metadata for uploads—accessible viaCrudEntry.metadata
.ignoreEmptyUpdates
: Skips generating CRUD entries when no data actually changes—reduces noise inuploadData
.
1.0.0
This SDK is now in a stable V1 release
[BREAKING CHANGES]
Completing CRUD transactions or CRUD batches, in the
PowerSyncBackendConnector
uploadData
handler, now has a simpler invocation.index
basedSqlCursor
getters now throw if the query result column value isnil
. This is now consistent with the behaviour of named column getter operations. NewgetXxxxxOptional(index: index)
methods are available if the query result value could benil
.SqlCursor
getters now directly return Swift types.getLong
has been replaced withgetInt64
.Client parameters now need to be specified with strictly typed
JsonValue
enums.SyncStatus
values now use Swift primitives for status attributes.lastSyncedAt
now is ofDate
type.crudThrottleMs
andretryDelayMs
in theconnect
method have been updated tocrudThrottle
andretryDelay
which are now of typeTimeInterval
. Previously the parameters were specified in milliseconds, theTimeInterval
typing now requires values to be specified in seconds.throttleMs
in the watched queryWatchOptions
has been updated tothrottle
which is now of typeTimeInterval
. Previously the parameters were specified in milliseconds, theTimeInterval
typing now requires values to be specified in seconds.See code snippets here for all of the above.
[IMPROVED] Improved the stability of watched queries. Watched queries were previously susceptible to runtime crashes if an exception was thrown in the update stream. Errors are now gracefully handled.
[IMPROVED] Deprecated
PowerSyncCredentials
userId
field. This value is not used by the PowerSync service.[IMPROVED] Removed references to the PowerSync Kotlin SDK from all public API protocols. Dedicated Swift protocols are now defined. These protocols align better with Swift primitives. See the
BREAKING CHANGES
section above for more details, and see here for the complete list of updated protocols.[IMPROVED] Database and transaction/lock level query
execute
methods now have@discardableResult
annotation.[IMPROVED] Query methods'
parameters
typing has been updated to[Any?]
from[Any]
. This makes passingnil
or optional values to queries easier.[IMPROVED]
AttachmentContext
,AttachmentQueue
,AttachmentService
andSyncingService
are are now explicitly declared asopen
classes, allowing them to be subclassed outside the defining module.[ADDED] Added
readLock
andwriteLock
APIs. These methods allow obtaining a SQLite connection context without starting a transaction.
1.0.0-Beta.12
[ADDED] Introduced attachment sync helpers and a demo to showcase these. Learn how to get started here.
[FIXED] Cancellations in watched queries are now handled correctly.
1.0.0-Beta.11
[FIXED] Deadlock issue when
connect()
is called immediately after opening a database (introduced in 1.0.0-Beta.10).
1.0.0-Beta.10
[ADDED] The ability to enable custom logging. See docs here.
[ADDED]
.close()
method onPowerSyncDatabaseProtocol
to close a database connection.[FIXED] Updated the
powersync-kotlin
dependency to version1.0.0-BETA29
, which fixes these issues:Fixed a potential race condition between jobs in
connect()
anddisconnect()
.Fixed a race condition causing data received during uploads not to be applied.
Fixed an issue where automatic driver migrations would fail with the error:
Sqlite operation failure database is locked attempted to run migration and failed. closing connection
1.0.0-Beta.9
[ADDED] Enabled Full Text Search on iOS platforms. An example implementation is not yet available, however our JavaScript implementations can be used as a guide in the mean time, or reach out to us on Discord. (PR #145)
[ADDED] For advanced use cases: The ability to update the schema for existing PowerSync clients using
updateSchema()
. (PR #154)[IMPROVED] Unified concurrency model across platforms by introducing a pool of read connections and a single write connection, simplifying driver implementation and enabling concurrent reads. This also brings the architecture in line with other PowerSync SDKs. (PR #145)
[IMPROVED] Added queuing protection and warnings when connecting multiple PowerSync clients to the same database file, avoiding inconsistent state issues and improving the reliability of watched queries. (PR #146)
[IMPROVED] Switched to statically linking SQLite on native platforms since dynamic extension loading is disabled on Apple platforms. (PR #147)
[FIXED] A bug where local only, insert only and view name overrides were not applied for schema tables. (PR #154)
[FIXED] Updated powersync-sqlite-core to v0.3.12, which fixes
powersync_last_synced_at()
returning stale information.
1.0.0-Beta.8
[ADDED] Support for sync bucket priorities to sync critical data first. Learn more.
[ADDED] The ability to throttle watched queries via the optional
throttleMs
parameter. This will prevent these queries from re-running within the specified duration and therefore reduce the load for frequently updating tables.[IMPROVED] Internally improved the query logic for
watch()
queries, by optimizing table update handling, enhancing thread safety, and simplifying the implementation (see the PR).[FIXED] The
uploading
anddownloading
Sync Status indicators not correctly emitting status events.
1.0.0-Beta.7
[FIXED] An issue where throwing exceptions in the query
mapper
could cause a runtime crash.[IMPROVED] Internally improved type casting.
[IMPROVED] Internals of the
watch()
query.
1.0.0-Beta.6
[BREAKING CHANGE]:
watch
queries are now throwable and therefore will need to be accompanied by atry
e.g.
try database.watch()
[BREAKING CHANGE]:
transaction
functions are now throwable and therefore will need to be accompanied by atry
e.g.
try await database.writeTransaction { transaction in
try transaction.execute(...)
}
[IMPROVED] Allow
execute
errors to be handled[IMPROVED]
userId
is now set tonil
by default and therefore it is no longer required to be set tonil
when instantiatingPowerSyncCredentials
and can therefore be left out.
1.0.0-Beta.5
[IMPROVED] Error handling for errors originating in the Kotlin SDK.
[IMPROVED]
__fetchCredentials
to log the error but not cause an app crash on error.
1.0.0-Beta.4
[IMPROVED] Ability to use the column name to get the pertaining value when using the cursor instead of having to use the index number. The following functions now accept a column name parameter:
getBoolean
,getBooleanOptional
,getString
,getStringOptional
,getLong
,getLongOptional
,getDouble
,getDoubleOptional
.BREAKING CHANGE: This should not affect anyone, but we made
KotlinPowerSyncCredentials
,KotlinPowerSyncDatabase
andKotlinPowerSyncBackendConnector
private as these should never have been public.
1.0.0-Beta.3
BREAKING CHANGE: Updates the underlying
powersync-kotlin
package to BETA18.0 which requires transactions to become synchronous as opposed to asynchronous.Previously:
try await database.writeTransaction { transaction in try await transaction.execute( sql: "INSERT INTO users (id, name, email) VALUES (?, ?, ?)", parameters: ["1", "Test User", "test@example.com"] ) }
Now:
try await database.writeTransaction { transaction in transaction.execute( // <- This has become synchronous sql: "INSERT INTO users (id, name, email) VALUES (?, ?, ?)", parameters: ["1", "Test User", "test@example.com"] ) }
1.0.0-Beta.2
[FIXED] Updated
powersync-sqlite-core
to v0.3.8, which fixes a view migration issue (see details).[IMPROVED] Increase maximum amount of columns from 63 to 1999.
1.0.0-Beta.1
Initial Beta Release.