Skip to content
Merged
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
12 changes: 6 additions & 6 deletions Package.resolved

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

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Combine
import CoreData
Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/CoreDataRepository+Batch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Combine
import CoreData
Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/CoreDataRepository+CRUD.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Combine
import CoreData
Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/CoreDataRepository+Fetch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Combine
import CombineExt
Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/CoreDataRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Combine
import CoreData
Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/CoreDataRepositoryError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Foundation

Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/FetchSubscription.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Combine
import CoreData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import CoreData
import Foundation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import CoreData
import Foundation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import CoreData
import Foundation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Combine
import CoreData
Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/ReadSubscription.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Combine
import CoreData
Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/RepositoryManagedModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import CoreData

Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/Result+CRUDHelpers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import CoreData
import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/SubscriptionProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

public protocol SubscriptionProvider {
var id: AnyHashable { get }
Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/UnmanagedModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import CoreData
import Foundation
Expand Down
2 changes: 1 addition & 1 deletion Sources/CoreDataRepository/_Result.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Foundation

Expand Down
12 changes: 6 additions & 6 deletions Tests/CoreDataRepositoryTests/AggregateRepositoryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Combine
import CoreData
Expand All @@ -30,7 +30,7 @@ final class AggregateRepositoryTests: CoreDataXCTestCase {
override func setUpWithError() throws {
try super.setUpWithError()
try repositoryContext().performAndWait {
objectIDs = try movies.map { $0.asRepoManaged(in: try self.repositoryContext()).objectID }
objectIDs = try movies.map { try $0.asRepoManaged(in: self.repositoryContext()).objectID }
try repositoryContext().save()
}
}
Expand All @@ -56,7 +56,7 @@ final class AggregateRepositoryTests: CoreDataXCTestCase {
let result: Result<[[String: Decimal]], CoreDataRepositoryError> = try await repository().sum(
predicate: NSPredicate(value: true),
entityDesc: RepoMovie.entity(),
attributeDesc: try XCTUnwrap(
attributeDesc: XCTUnwrap(
RepoMovie.entity().attributesByName.values
.first(where: { $0.name == "boxOffice" })
)
Expand All @@ -74,7 +74,7 @@ final class AggregateRepositoryTests: CoreDataXCTestCase {
let result: Result<[[String: Decimal]], CoreDataRepositoryError> = try await repository().average(
predicate: NSPredicate(value: true),
entityDesc: RepoMovie.entity(),
attributeDesc: try XCTUnwrap(
attributeDesc: XCTUnwrap(
RepoMovie.entity().attributesByName.values
.first(where: { $0.name == "boxOffice" })
)
Expand All @@ -96,7 +96,7 @@ final class AggregateRepositoryTests: CoreDataXCTestCase {
let result: Result<[[String: Decimal]], CoreDataRepositoryError> = try await repository().min(
predicate: NSPredicate(value: true),
entityDesc: RepoMovie.entity(),
attributeDesc: try XCTUnwrap(
attributeDesc: XCTUnwrap(
RepoMovie.entity().attributesByName.values
.first(where: { $0.name == "boxOffice" })
)
Expand All @@ -118,7 +118,7 @@ final class AggregateRepositoryTests: CoreDataXCTestCase {
let result: Result<[[String: Decimal]], CoreDataRepositoryError> = try await repository().max(
predicate: NSPredicate(value: true),
entityDesc: RepoMovie.entity(),
attributeDesc: try XCTUnwrap(
attributeDesc: XCTUnwrap(
RepoMovie.entity().attributesByName.values
.first(where: { $0.name == "boxOffice" })
)
Expand Down
14 changes: 7 additions & 7 deletions Tests/CoreDataRepositoryTests/BatchRepositoryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// MIT License
//
// Copyright © 2022 Andrew Roan
// Copyright © 2023 Andrew Roan

import Combine
import CoreData
Expand Down Expand Up @@ -40,7 +40,7 @@ final class BatchRepositoryTests: CoreDataXCTestCase {

func mapDictToRepoMovie(_ dict: [String: Any]) throws -> RepoMovie {
try mapDictToMovie(dict)
.asRepoManaged(in: try repositoryContext())
.asRepoManaged(in: repositoryContext())
}

func mapDictToMovie(_ dict: [String: Any]) throws -> Movie {
Expand All @@ -57,7 +57,7 @@ final class BatchRepositoryTests: CoreDataXCTestCase {
XCTAssertEqual(count, 0, "Count of objects in CoreData should be zero at the start of each test.")
}

let request = NSBatchInsertRequest(entityName: try XCTUnwrap(RepoMovie.entity().name), objects: movies)
let request = try NSBatchInsertRequest(entityName: XCTUnwrap(RepoMovie.entity().name), objects: movies)
let result: Result<NSBatchInsertResult, CoreDataRepositoryError> = try await repository().insert(request)

switch result {
Expand All @@ -84,8 +84,8 @@ final class BatchRepositoryTests: CoreDataXCTestCase {
XCTAssertEqual(count, 0, "Count of objects in CoreData should be zero at the start of each test.")
}

let request = NSBatchInsertRequest(
entityName: try XCTUnwrap(RepoMovie.entity().name),
let request = try NSBatchInsertRequest(
entityName: XCTUnwrap(RepoMovie.entity().name),
objects: failureInsertMovies
)
let result: Result<NSBatchInsertResult, CoreDataRepositoryError> = try await repository().insert(request)
Expand Down Expand Up @@ -163,7 +163,7 @@ final class BatchRepositoryTests: CoreDataXCTestCase {
}

let predicate = NSPredicate(value: true)
let request = NSBatchUpdateRequest(entityName: try XCTUnwrap(RepoMovie.entity().name))
let request = try NSBatchUpdateRequest(entityName: XCTUnwrap(RepoMovie.entity().name))
request.predicate = predicate
request.propertiesToUpdate = ["title": "Updated!", "boxOffice": 1]

Expand Down Expand Up @@ -216,7 +216,7 @@ final class BatchRepositoryTests: CoreDataXCTestCase {
}

let request =
NSBatchDeleteRequest(fetchRequest: NSFetchRequest<NSFetchRequestResult>(entityName: try XCTUnwrap(
try NSBatchDeleteRequest(fetchRequest: NSFetchRequest<NSFetchRequestResult>(entityName: XCTUnwrap(
RepoMovie
.entity().name
)))
Expand Down
Loading