diff --git a/CoreStore.podspec b/CoreStore.podspec index d4e757e..7f0cee5 100644 --- a/CoreStore.podspec +++ b/CoreStore.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "CoreStore" - s.version = "9.0.0" + s.version = "9.1.0" s.swift_version = "5.7" s.license = "MIT" s.homepage = "https://github.com/JohnEstropia/CoreStore" @@ -30,6 +30,5 @@ Pod::Spec.new do |s| ts.ios.deployment_target = "13.0" ts.osx.deployment_target = "10.15" ts.tvos.deployment_target = "13.0" - ts.watchos.deployment_target = "7.4" end end diff --git a/CoreStore.xcodeproj/project.pbxproj b/CoreStore.xcodeproj/project.pbxproj index d9cb0d3..f460c70 100644 --- a/CoreStore.xcodeproj/project.pbxproj +++ b/CoreStore.xcodeproj/project.pbxproj @@ -15,6 +15,10 @@ 18166889232B9ED80097C275 /* String+KeyPaths.swift in Sources */ = {isa = PBXBuildFile; fileRef = B51B5C2A22D43931009FA3BA /* String+KeyPaths.swift */; }; 2F03A53619C5C6DA005002A5 /* CoreStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F03A53519C5C6DA005002A5 /* CoreStore.h */; settings = {ATTRIBUTES = (Public, ); }; }; 2F03A54D19C5C872005002A5 /* CoreData.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2F03A54C19C5C872005002A5 /* CoreData.framework */; }; + 53EB03E62A3AD5D400179430 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EB03E52A3AD5D400179430 /* Operators.swift */; }; + 53EB03E72A3AD5D400179430 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EB03E52A3AD5D400179430 /* Operators.swift */; }; + 53EB03E82A3AD5D400179430 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EB03E52A3AD5D400179430 /* Operators.swift */; }; + 53EB03E92A3AD5D400179430 /* Operators.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EB03E52A3AD5D400179430 /* Operators.swift */; }; 82BA18931C4BBCBA00A0916E /* CoreStore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82BA18891C4BBCBA00A0916E /* CoreStore.framework */; }; 82BA18A01C4BBD1400A0916E /* CoreStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F03A53519C5C6DA005002A5 /* CoreStore.h */; settings = {ATTRIBUTES = (Public, ); }; }; 82BA18A21C4BBD1D00A0916E /* CoreStoreError.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5D1E22B19FA9FBC003B2874 /* CoreStoreError.swift */; }; @@ -878,6 +882,7 @@ 2F03A53B19C5C6DA005002A5 /* CoreStoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreStoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 2F03A53E19C5C6DA005002A5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 2F03A54C19C5C872005002A5 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; + 53EB03E52A3AD5D400179430 /* Operators.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Operators.swift; sourceTree = ""; }; 82BA18891C4BBCBA00A0916E /* CoreStore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = CoreStore.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 82BA18921C4BBCBA00A0916E /* CoreStoreTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreStoreTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 82BA18DE1C4BBE2600A0916E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS9.1.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; @@ -1451,6 +1456,7 @@ B52F742E1E9B50D0005F3DAC /* SchemaHistory.swift */, B5D339E61E9493A500C880DE /* Entity.swift */, B5A991EB1E9DC2CE0091A2E3 /* VersionLock.swift */, + 53EB03E52A3AD5D400179430 /* Operators.swift */, ); name = "Dynamic Models"; sourceTree = ""; @@ -2171,6 +2177,7 @@ B5F9C093287849E0007AAD2E /* DataStack+Concurrency.swift in Sources */, B5BF7FC6234D7E460070E741 /* ObjectSnapshot.swift in Sources */, B5E84EF71AFF846E0064E85B /* UnsafeDataTransaction.swift in Sources */, + 53EB03E62A3AD5D400179430 /* Operators.swift in Sources */, B56964D41B22FFAD0075EE4A /* DataStack+Migration.swift in Sources */, B5D339DD1E9489C700C880DE /* DynamicObject.swift in Sources */, B50C3EE523D153EA00B29880 /* Field.Coded.swift in Sources */, @@ -2387,6 +2394,7 @@ B5F9C094287849E0007AAD2E /* DataStack+Concurrency.swift in Sources */, 82BA18AC1C4BBD3100A0916E /* SynchronousDataTransaction.swift in Sources */, B50C3EE623D153EA00B29880 /* Field.Coded.swift in Sources */, + 53EB03E72A3AD5D400179430 /* Operators.swift in Sources */, 82BA18C41C4BBD5300A0916E /* ListMonitor.swift in Sources */, B5215CAA1FA4810300139E3A /* QueryChainBuilder.swift in Sources */, B50E175823517DE4004F033C /* Differentiable.swift in Sources */, @@ -2638,6 +2646,7 @@ B5F9C096287849E0007AAD2E /* DataStack+Concurrency.swift in Sources */, B5D339EF1E9495E500C880DE /* CoreStoreObject+Querying.swift in Sources */, B52DD19F1BE1F92C00949AFE /* SynchronousDataTransaction.swift in Sources */, + 53EB03E92A3AD5D400179430 /* Operators.swift in Sources */, B52DD1CB1BE1F94600949AFE /* Internals.WeakObject.swift in Sources */, B5220E1A1D130791009BC71E /* Internals.CoreStoreFetchedResultsController.swift in Sources */, B5215CAC1FA4810300139E3A /* QueryChainBuilder.swift in Sources */, @@ -2854,6 +2863,7 @@ B5F9C095287849E0007AAD2E /* DataStack+Concurrency.swift in Sources */, B56321991BD65216006C9394 /* OrderBy.swift in Sources */, B50C3EE723D153EA00B29880 /* Field.Coded.swift in Sources */, + 53EB03E82A3AD5D400179430 /* Operators.swift in Sources */, B5D339EE1E9495E500C880DE /* CoreStoreObject+Querying.swift in Sources */, B56321A51BD65216006C9394 /* MigrationChain.swift in Sources */, B56321A21BD65216006C9394 /* ListObserver.swift in Sources */, @@ -3102,7 +3112,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 9.0.0; + MARKETING_VERSION = 9.1.0; OTHER_LDFLAGS = ( "-weak_framework", Combine, @@ -3126,7 +3136,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 13.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 9.0.0; + MARKETING_VERSION = 9.1.0; OTHER_LDFLAGS = ( "-weak_framework", Combine, @@ -3184,7 +3194,7 @@ GCC_NO_COMMON_BLOCKS = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 9.0.0; + MARKETING_VERSION = 9.1.0; OTHER_LDFLAGS = ( "-weak_framework", Combine, @@ -3211,7 +3221,7 @@ GCC_NO_COMMON_BLOCKS = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 9.0.0; + MARKETING_VERSION = 9.1.0; OTHER_LDFLAGS = ( "-weak_framework", Combine, @@ -3317,7 +3327,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 9.0.0; + MARKETING_VERSION = 9.1.0; OTHER_LDFLAGS = ( "-weak_framework", Combine, @@ -3348,7 +3358,7 @@ INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.15; - MARKETING_VERSION = 9.0.0; + MARKETING_VERSION = 9.1.0; OTHER_LDFLAGS = ( "-weak_framework", Combine, @@ -3414,7 +3424,7 @@ GCC_NO_COMMON_BLOCKS = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 9.0.0; + MARKETING_VERSION = 9.1.0; OTHER_LDFLAGS = ( "-weak_framework", Combine, @@ -3443,7 +3453,7 @@ GCC_NO_COMMON_BLOCKS = YES; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 9.0.0; + MARKETING_VERSION = 9.1.0; OTHER_LDFLAGS = ( "-weak_framework", Combine, diff --git a/CoreStoreTests/Info.plist b/CoreStoreTests/Info.plist index 89acc5e..b437fa4 100644 --- a/CoreStoreTests/Info.plist +++ b/CoreStoreTests/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType BNDL CFBundleShortVersionString - 9.0.0 + 9.1.0 CFBundleSignature ???? CFBundleVersion diff --git a/Demo/Sources/Demos/Modern/ColorsDemo/Modern.ColorsDemo.SwiftUI.ListView.swift b/Demo/Sources/Demos/Modern/ColorsDemo/Modern.ColorsDemo.SwiftUI.ListView.swift index ab57c19..e11a4cf 100644 --- a/Demo/Sources/Demos/Modern/ColorsDemo/Modern.ColorsDemo.SwiftUI.ListView.swift +++ b/Demo/Sources/Demos/Modern/ColorsDemo/Modern.ColorsDemo.SwiftUI.ListView.swift @@ -63,7 +63,7 @@ extension Modern.ColorsDemo.SwiftUI { } } } - .animation(.default) +// .animation(.default) // breaks layout .listStyle(PlainListStyle()) .edgesIgnoringSafeArea([]) } diff --git a/Package.swift b/Package.swift index 68aa8ca..c9813e5 100644 --- a/Package.swift +++ b/Package.swift @@ -39,8 +39,7 @@ let package = Package( .target( name: "CoreStore", dependencies: [], - path: "Sources", - exclude: ["CoreStoreBridge.h", "CoreStoreBridge.m"] + path: "Sources" ), .testTarget( name: "CoreStoreTests", diff --git a/README.md b/README.md index 8c6d767..2c72b0c 100644 --- a/README.md +++ b/README.md @@ -2449,7 +2449,7 @@ var body: some View { ### Install with CocoaPods In your `Podfile`, add ``` -pod 'CoreStore', '~> 9.0' +pod 'CoreStore', '~> 9.1' ``` and run ``` @@ -2460,7 +2460,7 @@ This installs CoreStore as a framework. Declare `import CoreStore` in your swift ### Install with Carthage In your `Cartfile`, add ``` -github "JohnEstropia/CoreStore" >= 9.0.0 +github "JohnEstropia/CoreStore" >= 9.1.0 ``` and run ``` @@ -2471,7 +2471,7 @@ This installs CoreStore as a framework. Declare `import CoreStore` in your swift #### Install with Swift Package Manager: ```swift dependencies: [ - .package(url: "https://github.com/JohnEstropia/CoreStore.git", from: "9.0.0")) + .package(url: "https://github.com/JohnEstropia/CoreStore.git", from: "9.1.0")) ] ``` Declare `import CoreStore` in your swift file to use the library. diff --git a/Sources/CoreStore+CustomDebugStringConvertible.swift b/Sources/CoreStore+CustomDebugStringConvertible.swift index ff56e49..9fc00fc 100644 --- a/Sources/CoreStore+CustomDebugStringConvertible.swift +++ b/Sources/CoreStore+CustomDebugStringConvertible.swift @@ -1215,8 +1215,14 @@ extension NSAttributeType: CoreStoreDebugStringConvertible { case .objectIDAttributeType: return ".objectIDAttributeType" case .UUIDAttributeType: return ".UUIDAttributeType" case .URIAttributeType: return ".URIAttributeType" + +#if swift(>=5.9) // Xcode 15 (iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0) + case .compositeAttributeType: return ".compositeAttributeType" + +#endif + @unknown default: - fatalError() + fatalError() } } } diff --git a/Sources/DynamicObject.swift b/Sources/DynamicObject.swift index 3013c37..605e1d1 100644 --- a/Sources/DynamicObject.swift +++ b/Sources/DynamicObject.swift @@ -114,9 +114,15 @@ extension NSManagedObject: DynamicObject { } public class func cs_fromRaw(object: NSManagedObject) -> Self { - + +#if swift(>=5.9) + return unsafeDowncast(object, to: self) + +#else // unsafeDowncast fails debug assertion starting Swift 5.2 return _unsafeUncheckedDowncast(object, to: self) + +#endif } public static func cs_matches(object: NSManagedObject) -> Bool { diff --git a/Sources/Internals.DiffableDataUIDispatcher.Changeset.swift b/Sources/Internals.DiffableDataUIDispatcher.Changeset.swift index bc972be..213cde6 100644 --- a/Sources/Internals.DiffableDataUIDispatcher.Changeset.swift +++ b/Sources/Internals.DiffableDataUIDispatcher.Changeset.swift @@ -48,7 +48,7 @@ extension Internals.DiffableDataUIDispatcher { var elementUpdated: [ElementPath] var elementMoved: [(source: ElementPath, target: ElementPath)] - @inlinable + @usableFromInline init( data: C, sectionDeleted: [Int] = [], diff --git a/Sources/Internals.DiffableDataUIDispatcher.DiffResult.swift b/Sources/Internals.DiffableDataUIDispatcher.DiffResult.swift index 17b7bd7..dc48716 100644 --- a/Sources/Internals.DiffableDataUIDispatcher.DiffResult.swift +++ b/Sources/Internals.DiffableDataUIDispatcher.DiffResult.swift @@ -190,7 +190,7 @@ extension Internals.DiffableDataUIDispatcher { // MARK: Private - @inlinable + @usableFromInline internal init( deleted: [Index] = [], inserted: [Index] = [], @@ -213,18 +213,18 @@ extension Internals.DiffableDataUIDispatcher { // Implementation based on https://github.com/ra1028/DifferenceKit @usableFromInline - internal struct Trace { - + internal struct Trace { + @usableFromInline - internal var reference: Index? - + internal var reference: I? + @usableFromInline internal var deleteOffset = 0 @usableFromInline internal var isTracked = false - @inlinable + @usableFromInline init() {} } @@ -252,7 +252,7 @@ extension Internals.DiffableDataUIDispatcher { @usableFromInline internal var position = 0 - @inlinable + @usableFromInline internal init(_ indices: ContiguousArray) { self.indices = indices @@ -292,7 +292,7 @@ extension Internals.DiffableDataUIDispatcher { @usableFromInline internal let pointer: UnsafePointer - @inlinable + @usableFromInline internal init(pointer: UnsafePointer) { self.pointeeHashValue = pointer.pointee.hashValue diff --git a/Sources/Internals.DiffableDataUIDispatcher.StagedChangeset.swift b/Sources/Internals.DiffableDataUIDispatcher.StagedChangeset.swift index 9d533b3..ce86cf4 100644 --- a/Sources/Internals.DiffableDataUIDispatcher.StagedChangeset.swift +++ b/Sources/Internals.DiffableDataUIDispatcher.StagedChangeset.swift @@ -40,7 +40,7 @@ extension Internals.DiffableDataUIDispatcher { @usableFromInline var changesets: ContiguousArray> - @inlinable + @usableFromInline init(_ changesets: S) where S.Element == Changeset { self.changesets = ContiguousArray(changesets) diff --git a/Sources/Internals.DiffableDataUIDispatcher.swift b/Sources/Internals.DiffableDataUIDispatcher.swift index acde1bf..b3f0237 100644 --- a/Sources/Internals.DiffableDataUIDispatcher.swift +++ b/Sources/Internals.DiffableDataUIDispatcher.swift @@ -221,7 +221,7 @@ extension Internals { @usableFromInline var section: Int - @inlinable + @usableFromInline init(element: Int, section: Int) { self.element = element diff --git a/Sources/Internals.EntityIdentifier.swift b/Sources/Internals.EntityIdentifier.swift index 6d3e45e..8129efe 100644 --- a/Sources/Internals.EntityIdentifier.swift +++ b/Sources/Internals.EntityIdentifier.swift @@ -74,7 +74,7 @@ extension Internals { default: Internals.abort("\(Internals.typeName(DynamicObject.self)) is not meant to be implemented by external types.") } - } + } internal init(_ entityDescription: NSEntityDescription) { diff --git a/Sources/Operators.swift b/Sources/Operators.swift new file mode 100644 index 0000000..e3e1e76 --- /dev/null +++ b/Sources/Operators.swift @@ -0,0 +1,47 @@ +// +// Operators.swift +// CoreStore +// +// Copyright © 2023 John Rommel Estropia +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// + + +infix operator .= : AssignmentPrecedence +infix operator .== : ComparisonPrecedence + + +infix operator &&? : LogicalConjunctionPrecedence +infix operator ||? : LogicalConjunctionPrecedence + + +// MARK: - ~ + +/** + Connects multiple `KeyPathStringConvertible`s to create a type-safe chain usable in query/fetch expressions +``` +let owner = dataStack.fetchOne( + From().where( + (\.master ~ \.name) == "John" + ) +) +``` + */ +infix operator ~ : AdditionPrecedence diff --git a/Sources/Relationship.ToManyOrdered.swift b/Sources/Relationship.ToManyOrdered.swift index 069eb0a..83b7b78 100644 --- a/Sources/Relationship.ToManyOrdered.swift +++ b/Sources/Relationship.ToManyOrdered.swift @@ -371,9 +371,6 @@ extension RelationshipContainer.ToManyOrdered: RandomAccessCollection { // MARK: - Operations -infix operator .= : AssignmentPrecedence -infix operator .== : ComparisonPrecedence - extension RelationshipContainer.ToManyOrdered { /** diff --git a/Sources/Relationship.ToManyUnordered.swift b/Sources/Relationship.ToManyUnordered.swift index c45471d..2f50286 100644 --- a/Sources/Relationship.ToManyUnordered.swift +++ b/Sources/Relationship.ToManyUnordered.swift @@ -364,9 +364,6 @@ extension RelationshipContainer.ToManyUnordered: Sequence { // MARK: - Operations -infix operator .= : AssignmentPrecedence -infix operator .== : ComparisonPrecedence - extension RelationshipContainer.ToManyUnordered { /** diff --git a/Sources/Relationship.ToOne.swift b/Sources/Relationship.ToOne.swift index 945eaa1..3bc7b91 100644 --- a/Sources/Relationship.ToOne.swift +++ b/Sources/Relationship.ToOne.swift @@ -304,10 +304,6 @@ extension RelationshipContainer { // MARK: - Operations - -infix operator .= : AssignmentPrecedence -infix operator .== : ComparisonPrecedence - extension RelationshipContainer.ToOne { /** diff --git a/Sources/Select.swift b/Sources/Select.swift index 91c43c4..79e987c 100644 --- a/Sources/Select.swift +++ b/Sources/Select.swift @@ -503,8 +503,8 @@ public struct Select: SelectClause, Hasha // MARK: Equatable - public static func == (lhs: Select, rhs: Select) -> Bool { - + public static func == (lhs: Select, rhs: Select) -> Bool { + return lhs.selectTerms == rhs.selectTerms } diff --git a/Sources/Transformable.Optional.swift b/Sources/Transformable.Optional.swift index 500800b..e0b4981 100644 --- a/Sources/Transformable.Optional.swift +++ b/Sources/Transformable.Optional.swift @@ -251,9 +251,6 @@ extension TransformableContainer { // MARK: - Operations -infix operator .= : AssignmentPrecedence -infix operator .== : ComparisonPrecedence - extension TransformableContainer.Optional { /** diff --git a/Sources/Transformable.Required.swift b/Sources/Transformable.Required.swift index 0b85d95..f473c98 100644 --- a/Sources/Transformable.Required.swift +++ b/Sources/Transformable.Required.swift @@ -254,9 +254,6 @@ extension TransformableContainer { // MARK: - Operations -infix operator .= : AssignmentPrecedence -infix operator .== : ComparisonPrecedence - extension TransformableContainer.Required { /** diff --git a/Sources/Value.Optional.swift b/Sources/Value.Optional.swift index a348254..7ead42f 100644 --- a/Sources/Value.Optional.swift +++ b/Sources/Value.Optional.swift @@ -252,9 +252,6 @@ extension ValueContainer { // MARK: - Operations -infix operator .= : AssignmentPrecedence -infix operator .== : ComparisonPrecedence - extension ValueContainer.Optional { /** diff --git a/Sources/Value.Required.swift b/Sources/Value.Required.swift index 7c007e2..b26b480 100644 --- a/Sources/Value.Required.swift +++ b/Sources/Value.Required.swift @@ -250,9 +250,6 @@ extension ValueContainer { // MARK: - Operations -infix operator .= : AssignmentPrecedence -infix operator .== : ComparisonPrecedence - extension ValueContainer.Required { /** diff --git a/Sources/Where.Expression.swift b/Sources/Where.Expression.swift index 8c0a0e7..4f8b06b 100644 --- a/Sources/Where.Expression.swift +++ b/Sources/Where.Expression.swift @@ -27,21 +27,6 @@ import Foundation import CoreData -// MARK: - ~ - -/** - Connects multiple `KeyPathStringConvertible`s to create a type-safe chain usable in query/fetch expressions -``` -let owner = dataStack.fetchOne( - From().where( - (\.master ~ \.name) == "John" - ) -) -``` - */ -infix operator ~ : AdditionPrecedence - - // MARK: - WhereExpressionTrait /** diff --git a/Sources/Where.swift b/Sources/Where.swift index c8a9e75..dd0f9cf 100644 --- a/Sources/Where.swift +++ b/Sources/Where.swift @@ -27,10 +27,6 @@ import Foundation import CoreData -infix operator &&? : LogicalConjunctionPrecedence -infix operator ||? : LogicalConjunctionPrecedence - - // MARK: - Where /** @@ -250,8 +246,8 @@ public struct Where: WhereClauseType, FetchClause, QueryClause - parameter keyPath: the keyPath to compare with - parameter object: the arguments for the `==` operator */ - public init(_ keyPath: KeyPathString, isEqualTo object: O?) { - + public init(_ keyPath: KeyPathString, isEqualTo object: Other?) { + switch object { case nil: diff --git a/docs/Classes.html b/docs/Classes.html index c1c4222..442faf0 100644 --- a/docs/Classes.html +++ b/docs/Classes.html @@ -21,20 +21,20 @@

- CoreStore Docs + CoreStore 9.1.0 Docs - (90% documented) + (91% documented)

-

+

-

+

- + GitHub View on GitHub

@@ -43,7 +43,7 @@ @@ -59,81 +59,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - @@ -170,6 +95,15 @@ + + + @@ -188,9 +122,27 @@ + + + + + + @@ -218,10 +170,10 @@ @@ -229,13 +181,7 @@ Enumerations + +
+
+ + +
+ +

SQLiteStore +

+
+
+
    +
  • +
    + + + + SQLiteStore + +
    +
    +
    +
    +
    +
    +

    A storage interface that is backed by an SQLite database.

    +
    +

    Warning

    + The default SQLite file location for the LegacySQLiteStore and SQLiteStore are different. If the app was depending on CoreStore’s default directories prior to 2.0.0, make sure to use the SQLiteStore.legacy(...) factory methods to create the SQLiteStore instead of using initializers directly. + +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SQLiteStore : LocalStorage
    +
    extension SQLiteStore: CustomDebugStringConvertible, CoreStoreDebugStringConvertible
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

SynchronousDataTransaction +

+
+
+
    +
  • + +
    +
    +
    +
    +
    +

    The SynchronousDataTransaction provides an interface for DynamicObject creates, updates, and deletes. A transaction object should typically be only used from within a transaction block initiated from DataStack.beginSynchronous(_:).

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class SynchronousDataTransaction : BaseDataTransaction
    +
    extension SynchronousDataTransaction: CustomDebugStringConvertible, CoreStoreDebugStringConvertible
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

UnsafeDataTransaction +

+
+
+
    +
  • +
    + + + + UnsafeDataTransaction + +
    +
    +
    +
    +
    +
    +

    The UnsafeDataTransaction provides an interface for non-contiguous NSManagedObject or CoreStoreObject creates, updates, and deletes. This is useful for making temporary changes, such as partially filled forms. An unsafe transaction object should typically be only used from the main queue.

    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class UnsafeDataTransaction : BaseDataTransaction
    +
    extension UnsafeDataTransaction: CustomDebugStringConvertible, CoreStoreDebugStringConvertible
    + +
    +
    +
    +
    +
  • +
+
+
+
+ + +
+ +

XcodeDataModelSchema +

+
+
+
    +
  • +
    + + + + XcodeDataModelSchema + +
    +
    +
    +
    +
    +
    +

    The XcodeDataModelSchema describes a model version declared in a single *.xcdatamodeld file.

    +
    CoreStoreDefaults.dataStack = DataStack(
    +    XcodeDataModelSchema(modelName: "MyAppV1", bundle: .main)
    +)
    +
    + + See more +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public final class XcodeDataModelSchema : DynamicSchema
    +
    extension XcodeDataModelSchema: CustomDebugStringConvertible, CoreStoreDebugStringConvertible
    @@ -2763,9 +1934,11 @@ Observers registered via addObserver(_:) are not retained. Li
    - -

    CoreStoreObjectValueDiff

    -
    +
    + +

    CoreStoreObjectValueDiff +

    +
    • @@ -2796,17 +1969,6 @@ Observers registered via addObserver(_:) are not retained. Li
  • -
-
-
- - @@ -229,13 +181,7 @@ Enumerations
@@ -1003,7 +1147,7 @@

Declaration

Swift

-
public override func create<D>(_ into: Into<D>) -> D where D : DynamicObject
+
public override func create<O>(_ into: Into<O>) -> O where O : DynamicObject
@@ -1038,7 +1182,7 @@ - edit(_:) + edit(_:)
@@ -1053,7 +1197,7 @@

Declaration

Swift

-
public override func edit<D>(_ object: D?) -> D? where D : DynamicObject
+
public override func edit<O>(_ object: O?) -> O? where O : DynamicObject
@@ -1088,7 +1232,7 @@ - edit(_:_:) + edit(_:_:)
@@ -1103,7 +1247,7 @@

Declaration

Swift

-
public override func edit<D>(_ into: Into<D>, _ objectID: NSManagedObjectID) -> D? where D : DynamicObject
+
public override func edit<O>(_ into: Into<O>, _ objectID: NSManagedObjectID) -> O? where O : DynamicObject
@@ -1148,9 +1292,9 @@
  • @@ -1158,14 +1302,60 @@
    -

    Deletes a specified NSManagedObject or CoreStoreObject.

    +

    Deletes the objects with the specified NSManagedObjectIDs.

    Declaration

    Swift

    -
    public override func delete<D>(_ object: D?) where D : DynamicObject
    +
    public override func delete<S>(objectIDs: S) where S : Sequence, S.Element : NSManagedObjectID
    + +
    +
    +
    +

    Parameters

    + + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectIDs of the objects to delete

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects or CoreStoreObjects represented by series of ObjectRepresentations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public override func delete<O>(_ object: O?, _ objects: O?...) where O : ObjectRepresentation
    @@ -1181,65 +1371,7 @@
    -

    the NSManagedObject or CoreStoreObject to be deleted

    -
    - - - - -
    - - -
  • -
  • -
    - - - - delete(_:_:_:) - -
    -
    -
    -
    -
    -
    -

    Deletes the specified DynamicObjects.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public override func delete<D>(_ object1: D?, _ object2: D?, _ objects: D?...) where D : DynamicObject
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - @@ -1251,7 +1383,7 @@ @@ -1264,9 +1396,9 @@
  • @@ -1274,14 +1406,14 @@
    -

    Deletes the specified DynamicObjects.

    +

    Deletes the specified NSManagedObjects or CoreStoreObjects represented by an ObjectRepresenation.

    Declaration

    Swift

    -
    public override func delete<S>(_ objects: S) where S : Sequence, S.Element : DynamicObject
    +
    public override func delete<S>(_ objects: S) where S : Sequence, S.Element : ObjectRepresentation
    @@ -1297,7 +1429,7 @@
  • @@ -1309,50 +1441,15 @@ -
    - - -
    - -

    CustomDebugStringConvertible

    -
    +
    + +

    CustomDebugStringConvertible +

    +
    • @@ -1389,9 +1486,8 @@
    - diff --git a/docs/Classes/BaseDataTransaction.html b/docs/Classes/BaseDataTransaction.html index 10644a0..d708630 100644 --- a/docs/Classes/BaseDataTransaction.html +++ b/docs/Classes/BaseDataTransaction.html @@ -21,20 +21,20 @@

    - CoreStore Docs + CoreStore 9.1.0 Docs - (90% documented) + (91% documented)

    -

    +

    -

    +

    - + GitHub View on GitHub

    @@ -43,7 +43,7 @@ @@ -59,81 +59,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - @@ -170,6 +95,15 @@ + + + @@ -188,9 +122,27 @@ + + + + + + @@ -218,10 +170,10 @@ @@ -229,13 +181,7 @@ Enumerations
    - - object1 - - -
    -

    the DynamicObject to be deleted

    -
    -
    - - object2 - - -
    -

    another DynamicObject to be deleted

    +

    the ObjectRepresentation representing an NSManagedObject or CoreStoreObject to be deleted

    -

    other DynamicObjects to be deleted

    +

    other ObjectRepresentations representing NSManagedObjects or CoreStoreObjects to be deleted

    -

    the DynamicObjects to be deleted

    +

    the ObjectRepresenations representing NSManagedObjects or CoreStoreObjects to be deleted

    + + + + + + +
    + + objectIDs + + +
    +

    the NSManagedObjectIDs of the objects to delete

    +
    +
    +
    +
    +
    +
  • +
  • +
    + + + + delete(_:_:) + +
    +
    +
    +
    +
    +
    +

    Deletes the specified NSManagedObjects or CoreStoreObjects represented by series of ObjectRepresentations.

    + +
    +
    +

    Declaration

    +
    +

    Swift

    +
    public func delete<O>(_ object: O?, _ objects: O?...) where O : ObjectRepresentation
    @@ -1130,65 +1318,7 @@
    -

    the NSManagedObject or CoreStoreObject to be deleted

    -
    - - - - -
    - - -
  • -
  • -
    - - - - delete(_:_:_:) - -
    -
    -
    -
    -
    -
    -

    Deletes the specified NSManagedObjects or CoreStoreObjects.

    - -
    -
    -

    Declaration

    -
    -

    Swift

    -
    public func delete<D>(_ object1: D?, _ object2: D?, _ objects: D?...) where D : DynamicObject
    - -
    -
    -
    -

    Parameters

    - - - - - - - - - @@ -1200,7 +1330,7 @@ @@ -1213,9 +1343,9 @@
  • @@ -1223,14 +1353,14 @@
    -

    Deletes the specified NSManagedObjects or CoreStoreObjects.

    +

    Deletes the specified NSManagedObjects or CoreStoreObjects represented by an ObjectRepresenation.

    Declaration

    Swift

    -
    public func delete<S>(_ objects: S) where S : Sequence, S.Element : DynamicObject
    +
    public func delete<S>(_ objects: S) where S : Sequence, S.Element : ObjectRepresentation
    @@ -1246,7 +1376,7 @@
  • @@ -1289,17 +1419,69 @@
    - -

    Inspecting Pending Objects

    -
    +
    + +

    Inspecting Pending Objects +

    +
      +
    • + +
      +
      +
      +
      +
      +

      Returns true if the object has any property values changed. This method should not be called after the commit() method was called.

      + +
      +
      +

      Declaration

      +
      +

      Swift

      +
      public func objectHasPersistentChangedValues<O>(_ object: O) -> Bool where O : DynamicObject
      + +
      +
      +
      +

      Parameters

      +
    - - object1 - - -
    -

    the NSManagedObject or CoreStoreObject to be deleted

    -
    -
    - - object2 - - -
    -

    another NSManagedObject or CoreStoreObject to be deleted

    +

    the ObjectRepresentation representing an NSManagedObject or CoreStoreObject to be deleted

    -

    other NSManagedObjects or CoreStoreObjects to be deleted

    +

    other ObjectRepresentations representing NSManagedObjects or CoreStoreObjects to be deleted

    -

    the NSManagedObjects or CoreStoreObjects to be deleted

    +

    the ObjectRepresenations representing NSManagedObjects or CoreStoreObjects to be deleted

    + + + + + + +
    + + object + + +
    +

    the DynamicObject instance

    +
    +
    +
    +
    +

    Return Value

    +

    true if the object has any property values changed.

    +
    +
    +
    +
  • @@ -1314,7 +1496,7 @@

    Declaration

    Swift

    -
    public func insertedObjects<D>(_ entity: D.Type) -> Set<D> where D : DynamicObject, D : Hashable
    +
    public func insertedObjects<O>(_ entity: O.Type) -> Set<O> where O : DynamicObject, O : Hashable
    @@ -1380,7 +1562,7 @@ - insertedObjectIDs(_:) + insertedObjectIDs(_:)
    @@ -1395,7 +1577,7 @@

    Declaration

    Swift

    -
    public func insertedObjectIDs<D>(_ entity: D.Type) -> Set<NSManagedObjectID> where D : DynamicObject
    +
    public func insertedObjectIDs<O>(_ entity: O.Type) -> Set<NSManagedObjectID> where O : DynamicObject
    @@ -1430,7 +1612,7 @@ - updatedObjects(_:) + updatedObjects(_:)
    @@ -1445,7 +1627,7 @@

    Declaration

    Swift

    -
    public func updatedObjects<D>(_ entity: D.Type) -> Set<D> where D : DynamicObject, D : Hashable
    +
    public func updatedObjects<O>(_ entity: O.Type) -> Set<O> where O : DynamicObject, O : Hashable
    @@ -1511,7 +1693,7 @@ - updatedObjectIDs(_:) + updatedObjectIDs(_:)
    @@ -1526,7 +1708,7 @@

    Declaration

    Swift

    -
    public func updatedObjectIDs<D>(_ entity: D.Type) -> Set<NSManagedObjectID> where D : DynamicObject
    +
    public func updatedObjectIDs<O>(_ entity: O.Type) -> Set<NSManagedObjectID> where O : DynamicObject
    @@ -1561,7 +1743,7 @@ - deletedObjects(_:) + deletedObjects(_:)
    @@ -1576,7 +1758,7 @@

    Declaration

    Swift

    -
    public func deletedObjects<D>(_ entity: D.Type) -> Set<D> where D : DynamicObject, D : Hashable
    +
    public func deletedObjects<O>(_ entity: O.Type) -> Set<O> where O : DynamicObject, O : Hashable
    @@ -1661,7 +1843,7 @@ - deletedObjectIDs(_:) + deletedObjectIDs(_:)
    @@ -1676,7 +1858,7 @@

    Declaration

    Swift

    -
    public func deletedObjectIDs<D>(_ entity: D.Type) -> Set<NSManagedObjectID> where D : DynamicObject
    +
    public func deletedObjectIDs<O>(_ entity: O.Type) -> Set<NSManagedObjectID> where O : DynamicObject
    @@ -1712,11 +1894,40 @@
    - -

    3rd Party Utilities

    -
    +
    + +

    3rd Party Utilities +

    +