Skip to content

Commit 2277b9d

Browse files
cleanup
1 parent 977fa0e commit 2277b9d

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44

55
- 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.
66

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.
7+
- Added `readLock` and `writeLock` APIs. These methods allow obtaining a SQLite connection context without starting a transaction.
8+
9+
- 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 `BRAKING CHANGES` section for more details. Updated protocols include:
10+
11+
- `ConnectionContext` - The context provided by `readLock` and `writeLock`
12+
- `Transaction` - The context provided by `readTransaction` and `writeTransaction`
13+
- `CrudBatch` - Response from `getCrudBatch`
14+
- `CrudTransaction` Response from `getNextCrudTransaction`
15+
- `CrudEntry` - Crud entries for `CrudBatch` and `CrudTransaction`
16+
- `UpdateType` - Operation type for `CrudEntry`s
17+
- `SqlCursor` - Cursor used to map SQLite results to typed result sets
18+
- `JsonParam` - JSON parameters used to declare client parameters in the `connect` method
19+
- `JsonValue` - Individual JSON field types for `JsonParam`
820

921
- Database and transaction/lock level query `execute` methods now have `@discardableResult` annotation.
1022

Demo/PowerSyncExample/PowerSync/SystemManager.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ class SystemManager {
127127
sql: "SELECT photo_id FROM \(TODOS_TABLE) WHERE list_id = ? AND photo_id IS NOT NULL",
128128
parameters: [id]
129129
) { cursor in
130-
131130
try cursor.getString(index: 0)
132131
}
133132

Sources/PowerSync/Kotlin/db/KotlinSqlCursor.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class KotlinSqlCursor: SqlCursor {
2828
}
2929

3030
func getBoolean(name: String) throws -> Bool {
31-
try guardColumnName(name)
3231
guard let result = try getBooleanOptional(name: name) else {
3332
throw SqlCursorError.nullValueFound(name)
3433
}
@@ -52,7 +51,6 @@ class KotlinSqlCursor: SqlCursor {
5251
}
5352

5453
func getDouble(name: String) throws -> Double {
55-
try guardColumnName(name)
5654
guard let result = try getDoubleOptional(name: name) else {
5755
throw SqlCursorError.nullValueFound(name)
5856
}
@@ -76,7 +74,6 @@ class KotlinSqlCursor: SqlCursor {
7674
}
7775

7876
func getInt(name: String) throws -> Int {
79-
try guardColumnName(name)
8077
guard let result = try getIntOptional(name: name) else {
8178
throw SqlCursorError.nullValueFound(name)
8279
}
@@ -100,7 +97,6 @@ class KotlinSqlCursor: SqlCursor {
10097
}
10198

10299
func getInt64(name: String) throws -> Int64 {
103-
try guardColumnName(name)
104100
guard let result = try getInt64Optional(name: name) else {
105101
throw SqlCursorError.nullValueFound(name)
106102
}
@@ -124,7 +120,6 @@ class KotlinSqlCursor: SqlCursor {
124120
}
125121

126122
func getString(name: String) throws -> String {
127-
try guardColumnName(name)
128123
guard let result = try getStringOptional(name: name) else {
129124
throw SqlCursorError.nullValueFound(name)
130125
}

Sources/PowerSync/Protocol/db/CrudBatch.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
import Foundation
42

53
/// A transaction of client-side changes.

Sources/PowerSync/Protocol/db/SqlCursor.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public enum SqlCursorError: Error {
154154
}
155155
}
156156

157-
public extension SqlCursorError: LocalizedError {
157+
extension SqlCursorError: LocalizedError {
158158
public var errorDescription: String? {
159159
switch self {
160160
case .columnNotFound(let name):

0 commit comments

Comments
 (0)