Skip to content

Commit 9196f8a

Browse files
[Release] 1.7.0 (#90)
* update changelog for release * Fix Swift 6 build
1 parent 78dfa07 commit 9196f8a

File tree

3 files changed

+13
-11
lines changed

3 files changed

+13
-11
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## 1.6.1 (unreleased)
3+
## 1.7.0
44

55
* Update Kotlin SDK to 1.7.0.
66
* Add `close(deleteDatabase:)` method to `PowerSyncDatabaseProtocol` for deleting SQLite database files when closing the database. This includes the main database file and all WAL mode files (.wal, .shm, .journal). Files that don't exist are ignored, but an error is thrown if a file exists but cannot be deleted.
@@ -14,6 +14,9 @@ try await database.close(deleteDatabase: false)
1414
// or simply
1515
try await database.close()
1616
```
17+
* Add `PowerSyncDataTypeConvertible` protocol for casting query parameters to SQLite supported types.
18+
* [Internal] Removed unnecessary `Task` creation in Attachment helper `FileManagerStorageAdapter`.
19+
1720
## 1.6.0
1821

1922
* Update core extension to 0.4.6 ([changelog](https://github.com/powersync-ja/powersync-sqlite-core/releases/tag/v0.4.6))

Sources/PowerSync/Kotlin/db/KotlinConnectionContext.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ final class KotlinTransactionContext: Transaction, KotlinConnectionContextProtoc
9898
func mapParameters(_ parameters: [Any?]?) -> [Any] {
9999
parameters?.map { item in
100100
switch item {
101-
case .none: NSNull()
102-
case let item as PowerSyncDataTypeConvertible:
103-
item.psDataType?.unwrap() ?? NSNull()
104-
default: item
101+
case .none: NSNull()
102+
case let item as PowerSyncDataTypeConvertible:
103+
item.psDataType?.unwrap() ?? NSNull()
104+
default: item as Any
105105
}
106106
} ?? []
107107
}

Tests/PowerSyncTests/Kotlin/KotlinPowerSyncDatabaseImplTests.swift

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@testable import PowerSync
21
import struct Foundation.UUID
2+
@testable import PowerSync
33
import XCTest
44

55
final class KotlinPowerSyncDatabaseImplTests: XCTestCase {
@@ -164,11 +164,11 @@ final class KotlinPowerSyncDatabaseImplTests: XCTestCase {
164164
parameters: [uuid, "Test User", "test@example.com"]
165165
)
166166

167-
let _ = try await database.getOptional(
167+
_ = try await database.getOptional(
168168
sql: "SELECT id, name, email FROM users WHERE id = ?",
169169
parameters: [uuid]
170170
) { cursor throws in
171-
try (
171+
try (
172172
cursor.getString(name: "id"),
173173
cursor.getString(name: "name"),
174174
cursor.getString(name: "email")
@@ -719,9 +719,8 @@ final class KotlinPowerSyncDatabaseImplTests: XCTestCase {
719719
}
720720
}
721721

722-
723-
extension UUID: @retroactive PowerSyncDataTypeConvertible {
722+
extension UUID: PowerSyncDataTypeConvertible {
724723
public var psDataType: PowerSyncDataType? {
725724
.string(uuidString)
726725
}
727-
}
726+
}

0 commit comments

Comments
 (0)