|
2 | 2 |
|
3 | 3 | # 1.0.0-Beta.14 |
4 | 4 |
|
5 | | -- Removed references to the PowerSync Kotlin SDK from all public API protocols. |
6 | 5 | - 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. |
7 | 6 |
|
| 7 | +- 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. |
| 8 | + |
| 9 | +- Database and transaction/lock level query `execute` methods now have `@discardableResult` annotation. |
| 10 | + |
| 11 | +- `AttachmentContext`, `AttachmentQueue`, `AttachmentService` and `SyncingService` are are now explicitly declared as `open` classes, allowing them to be subclassed outside the defining module. |
| 12 | + |
| 13 | +**BREAKING CHANGES**: |
| 14 | + |
| 15 | +- Completing CRUD transactions or CRUD batches, in the `PowerSyncBackendConnector` `uploadData` handler, now has a simpler invocation. |
| 16 | + |
| 17 | +```diff |
| 18 | +- _ = try await transaction.complete.invoke(p1: nil) |
| 19 | ++ try await transaction.complete() |
| 20 | +``` |
| 21 | + |
| 22 | +- `index` based `SqlCursor` getters now throw if the query result column value is `nil`. This is now consistent with the behaviour of named column getter operations. New `getXxxxxOptional(index: index)` methods are available if the query result value could be `nil`. |
| 23 | + |
| 24 | +```diff |
| 25 | +let results = try transaction.getAll( |
| 26 | + sql: "SELECT * FROM my_table", |
| 27 | + parameters: [id] |
| 28 | + ) { cursor in |
| 29 | +- cursor.getString(index: 0)! |
| 30 | ++ cursor.getStringOptional(index: 0) |
| 31 | ++ // OR |
| 32 | ++ // try cursor.getString(index: 0) // if the value should be required |
| 33 | + } |
| 34 | +``` |
| 35 | + |
| 36 | +- `SqlCursor` getters now directly return Swift types. `getLong` has been replaced with `getInt64`. |
| 37 | + |
| 38 | +```diff |
| 39 | +let results = try transaction.getAll( |
| 40 | + sql: "SELECT * FROM my_table", |
| 41 | + parameters: [id] |
| 42 | + ) { cursor in |
| 43 | +- cursor.getBoolean(index: 0)?.boolValue, |
| 44 | ++ cursor.getBooleanOptional(index: 0), |
| 45 | +- cursor.getLong(index: 0)?.int64Value, |
| 46 | ++ cursor.getInt64Optional(index: 0) |
| 47 | ++ // OR |
| 48 | ++ // try cursor.getInt64(index: 0) // if the value should be required |
| 49 | + } |
| 50 | +``` |
| 51 | + |
| 52 | +- Client parameters now need to be specified with strictly typed `JsonParam` enums. |
| 53 | + |
| 54 | +```diff |
| 55 | +try await database.connect( |
| 56 | + connector: PowerSyncBackendConnector(), |
| 57 | + params: [ |
| 58 | +- "foo": "bar" |
| 59 | ++ "foo": .string("bar") |
| 60 | + ] |
| 61 | +) |
| 62 | +``` |
| 63 | + |
| 64 | +- `SyncStatus` values now use Swift primitives for status attributes. `lastSyncedAt` now is of `Date` type. |
| 65 | + |
| 66 | +```diff |
| 67 | +- let lastTime: Date? = db.currentStatus.lastSyncedAt?.flatMap { |
| 68 | +- Date(timeIntervalSince1970: $0.epochSeconds) |
| 69 | +- } |
| 70 | ++ let time: Date? = db.currentStatus.lastSyncedAt |
| 71 | +``` |
| 72 | + |
8 | 73 | # 1.0.0-Beta.13 |
9 | 74 |
|
10 | 75 | - Update `powersync-kotlin` dependency to version `1.0.0-BETA32`, which includes: |
|
0 commit comments