From 9bdce8038785e9431f53a0ebe18738593ae37400 Mon Sep 17 00:00:00 2001 From: stevensJourney Date: Thu, 6 Nov 2025 13:07:27 +0200 Subject: [PATCH 1/2] update changelog for release --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a3d7c0..36549ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 1.6.1 (unreleased) +## 1.7.0 * Update Kotlin SDK to 1.7.0. * 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) // or simply try await database.close() ``` +* Add `PowerSyncDataTypeConvertible` protocol for casting query parameters to SQLite supported types. +* [Internal] Removed unnecessary `Task` creation in Attachment helper `FileManagerStorageAdapter`. + ## 1.6.0 * Update core extension to 0.4.6 ([changelog](https://github.com/powersync-ja/powersync-sqlite-core/releases/tag/v0.4.6)) From 871d9655bdf5624e280eb8918eff3904b3dc6f54 Mon Sep 17 00:00:00 2001 From: stevensJourney Date: Thu, 6 Nov 2025 13:14:30 +0200 Subject: [PATCH 2/2] Fix Swift 6 build --- .../PowerSync/Kotlin/db/KotlinConnectionContext.swift | 8 ++++---- .../Kotlin/KotlinPowerSyncDatabaseImplTests.swift | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/Sources/PowerSync/Kotlin/db/KotlinConnectionContext.swift b/Sources/PowerSync/Kotlin/db/KotlinConnectionContext.swift index c280a26..668b3a1 100644 --- a/Sources/PowerSync/Kotlin/db/KotlinConnectionContext.swift +++ b/Sources/PowerSync/Kotlin/db/KotlinConnectionContext.swift @@ -98,10 +98,10 @@ final class KotlinTransactionContext: Transaction, KotlinConnectionContextProtoc func mapParameters(_ parameters: [Any?]?) -> [Any] { parameters?.map { item in switch item { - case .none: NSNull() - case let item as PowerSyncDataTypeConvertible: - item.psDataType?.unwrap() ?? NSNull() - default: item + case .none: NSNull() + case let item as PowerSyncDataTypeConvertible: + item.psDataType?.unwrap() ?? NSNull() + default: item as Any } } ?? [] } diff --git a/Tests/PowerSyncTests/Kotlin/KotlinPowerSyncDatabaseImplTests.swift b/Tests/PowerSyncTests/Kotlin/KotlinPowerSyncDatabaseImplTests.swift index 2cd3843..c5e4327 100644 --- a/Tests/PowerSyncTests/Kotlin/KotlinPowerSyncDatabaseImplTests.swift +++ b/Tests/PowerSyncTests/Kotlin/KotlinPowerSyncDatabaseImplTests.swift @@ -1,5 +1,5 @@ -@testable import PowerSync import struct Foundation.UUID +@testable import PowerSync import XCTest final class KotlinPowerSyncDatabaseImplTests: XCTestCase { @@ -164,11 +164,11 @@ final class KotlinPowerSyncDatabaseImplTests: XCTestCase { parameters: [uuid, "Test User", "test@example.com"] ) - let _ = try await database.getOptional( + _ = try await database.getOptional( sql: "SELECT id, name, email FROM users WHERE id = ?", parameters: [uuid] ) { cursor throws in - try ( + try ( cursor.getString(name: "id"), cursor.getString(name: "name"), cursor.getString(name: "email") @@ -719,9 +719,8 @@ final class KotlinPowerSyncDatabaseImplTests: XCTestCase { } } - -extension UUID: @retroactive PowerSyncDataTypeConvertible { +extension UUID: PowerSyncDataTypeConvertible { public var psDataType: PowerSyncDataType? { .string(uuidString) } -} \ No newline at end of file +}