Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: macOS
strategy:
matrix:
xcode: ["26.6"]
xcode: ["26.2"]
config: ["debug", "release"]
runs-on: macos-26
steps:
Expand All @@ -32,7 +32,7 @@ jobs:
name: Examples
strategy:
matrix:
xcode: ["26.6"]
xcode: ["26.2"]
config: ["debug"]
scheme: ["Reminders", "CaseStudies", "SyncUps"]
runs-on: macos-26
Expand Down
6 changes: 5 additions & 1 deletion Examples/Examples.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,6 @@
isa = XCLocalSwiftPackageReference;
relativePath = ..;
traits = (
CasePaths,
LazyInitializableByDefault,
);
};
Expand All @@ -1122,6 +1121,9 @@
kind = upToNextMajorVersion;
minimumVersion = 1.7.0;
};
traits = (
Clocks,
);
};
DCBE8A122D4842BF0071F499 /* XCRemoteSwiftPackageReference "swift-case-paths" */ = {
isa = XCRemoteSwiftPackageReference;
Expand All @@ -1138,6 +1140,8 @@
kind = upToNextMajorVersion;
minimumVersion = 2.2.3;
};
traits = (
);
};
/* End XCRemoteSwiftPackageReference section */

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 14 additions & 14 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ let package = Package(
.target(
name: "SQLiteData",
dependencies: [
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(name: "Dependencies", package: "swift-dependencies"),
.product(name: "GRDB", package: "GRDB.swift"),
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
Expand All @@ -86,6 +87,7 @@ let package = Package(
name: "SQLiteDataTestSupport",
dependencies: [
"SQLiteData",
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(name: "ConcurrencyExtrasTestSupport", package: "swift-concurrency-extras"),
.product(name: "CustomDump", package: "swift-custom-dump"),
.product(name: "Dependencies", package: "swift-dependencies"),
Expand Down
2 changes: 2 additions & 0 deletions Package@swift-6.0.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ let package = Package(
.target(
name: "SQLiteData",
dependencies: [
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(name: "Dependencies", package: "swift-dependencies"),
.product(name: "GRDB", package: "GRDB.swift"),
.product(name: "IssueReporting", package: "xctest-dynamic-overlay"),
Expand All @@ -47,6 +48,7 @@ let package = Package(
name: "SQLiteDataTestSupport",
dependencies: [
"SQLiteData",
.product(name: "ConcurrencyExtras", package: "swift-concurrency-extras"),
.product(name: "CustomDump", package: "swift-custom-dump"),
.product(name: "Dependencies", package: "swift-dependencies"),
.product(name: "InlineSnapshotTesting", package: "swift-snapshot-testing"),
Expand Down
3 changes: 2 additions & 1 deletion Sources/SQLiteData/CloudKit/CloudKitSharing.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#if canImport(CloudKit)
public import CloudKit
import ConcurrencyExtras
import GRDB
import IssueReporting
public import StructuredQueries
Expand Down Expand Up @@ -240,7 +241,7 @@
}

func unshare(share: CKShare) async throws {
let result = try await syncEngines.withLock(\.private)?.database.modifyRecords(
let result = try await syncEngines.private?.database.modifyRecords(
saving: [],
deleting: [share.recordID]
)
Expand Down
7 changes: 4 additions & 3 deletions Sources/SQLiteData/CloudKit/Internal/DataManager.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if canImport(CloudKit) && canImport(CryptoKit)
package import ConcurrencyExtras
import CryptoKit
import Dependencies
package import Foundation
Expand Down Expand Up @@ -54,7 +55,7 @@
package init() {}

package func load(_ url: URL) throws -> Data {
try storage.withLock { storage in
try storage.withValue { storage in
guard let data = storage[url]
else {
struct FileNotFound: Error {}
Expand All @@ -65,11 +66,11 @@
}

package func save(_ data: Data, to url: URL) throws {
storage.withLock { $0[url] = data }
storage.withValue { $0[url] = data }
}

package func sha256(of fileURL: URL) -> Data? {
storage.withLock {
storage.withValue {
$0[fileURL].map {
Data(SHA256.hash(data: $0))
}
Expand Down
11 changes: 6 additions & 5 deletions Sources/SQLiteData/CloudKit/Internal/MockCloudContainer.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#if canImport(CloudKit)
package import ConcurrencyExtras
package import CloudKit
import Dependencies

Expand All @@ -22,21 +23,21 @@

guard let containerIdentifier else { return }
@Dependency(\.mockCloudContainers) var mockCloudContainers
mockCloudContainers.withLock { storage in
mockCloudContainers.withValue { storage in
storage[containerIdentifier] = self
}
}

package func accountStatus() -> CKAccountStatus {
_accountStatus.withLock(\.self)
_accountStatus.withValue(\.self)
}

package var rawValue: CKContainer {
fatalError("This should never be called in tests.")
}

package func accountStatus() async throws -> CKAccountStatus {
_accountStatus.withLock { $0 }
_accountStatus.withValue { $0 }
}

package func shareMetadata(
Expand All @@ -48,7 +49,7 @@
? privateCloudDatabase
: sharedCloudDatabase

let rootRecord: CKRecord? = database.state.withLock {
let rootRecord: CKRecord? = database.state.withValue {
$0.storage[share.recordID.zoneID]?.records.values.first { record in
record.share?.recordID == share.recordID
}
Expand Down Expand Up @@ -79,7 +80,7 @@
-> MockCloudContainer
{
@Dependency(\.mockCloudContainers) var mockCloudContainers
return mockCloudContainers.withLock { storage in
return mockCloudContainers.withValue { storage in
let container: MockCloudContainer
if let existingContainer = storage[containerIdentifier] {
return existingContainer
Expand Down
Loading