QueryKit, a simple type-safe Core Data query language.

Related tags

Core Data QueryKit
Overview

QueryKit Logo

QueryKit

QueryKit, a simple type-safe Core Data query language.

Usage

= 18) ">
QuerySet<Person>(context, "Person")
  .orderedBy(.name, ascending: true)
  .filter(\.age >= 18)

QuerySet

A QuerySet represents a collection of objects from your Core Data Store. It may have zero, one or many filters. Filters narrow down the query results based on the given parameters.

Retrieving all objects

let queryset = QuerySet<Person>(context, "Person")

Retrieving specific objects with filters

You may filter a QuerySet using the filter and exclude methods, which accept a predicate which can be constructed using KeyPath extensions.

The filter and exclude methods return new QuerySet's including your filter.

25) ">
queryset.filter(\.name == "Kyle")
queryset.exclude(\.age > 25)

You may also use standard NSPredicate if you want to construct complicated queries or do not wish to use the type-safe properties.

25")) ">
queryset.filter(NSPredicate(format: "name == '%@'", "Kyle"))
queryset.exclude(NSPredicate(format: "age > 25"))
Chaining filters

The result of refining a QuerySet is itself a QuerySet, so it’s possible to chain refinements together. For example:

queryset.filter(\.name == "Kyle")
       .exclude(\.age < 25)

Each time you refine a QuerySet, you get a new QuerySet instance that is in no way bound to the previous QuerySet. Each refinement creates a separate and distinct QuerySet that may be stored, used and reused.

QuerySets are lazy

A QuerySet is lazy, creating a QuerySet doesn’t involve querying Core Data. QueryKit won’t actually execute the query until the QuerySet is evaluated.

Ordering

You may order a QuerySet's results by using the orderBy function which accepts a KeyPath.

queryset.orderBy(\.name, ascending: true)

You may also pass in an NSSortDescriptor if you would rather.

queryset.orderBy(NSSortDescriptor(key: "name", ascending: true))

Slicing

Using slicing, a QuerySet's results may be limited to a specified range. For example, to get the first 5 items in our QuerySet:

queryset[0...5]

NOTE: Remember, QuerySets are lazily evaluated. Slicing doesn’t evaluate the query.

Fetching

Multiple objects

You may convert a QuerySet to an array using the array() function. For example:

for person in try! queryset.array() {
  println("Hello \(person.name).")
}
First object
let kyle = try? queryset.first()
Last object
let kyle = try? queryset.last()
Object at index
let katie = try? queryset.object(3)
Count
let numberOfPeople = try? queryset.count()
Deleting

This method immediately deletes the objects in your queryset and returns a count or an error if the operation failed.

let deleted = try? queryset.delete()
Operators

QueryKit provides KeyPath extensions providing operator functions allowing you to create predicates.

= 25 // Age is within the range 22 to 30. \Person.age << (22...30) ">
// Name is equal to Kyle
\Person.name == "Kyle"

// Name is either equal to Kyle or Katie
\.Person.name << ["Kyle", "Katie"]

// Age is equal to 27
\.Person.age == 27

// Age is more than or equal to 25
\Person.age >= 25

// Age is within the range 22 to 30.
\Person.age << (22...30)

The following types of comparisons are supported using Attribute:

Comparison Meaning
== x equals y
!= x is not equal to y
< x is less than y
<= x is less than or equal to y
> x is more than y
>= x is more than or equal to y
~= x is like y
~= x is like y
<< x IN y, where y is an array
<< x BETWEEN y, where y is a range
Predicate extensions

QueryKit provides the !, && and || operators for joining multiple predicates together.

= 25 && \Person.name == "Kyle" // Persons name is not Kyle !(\Person.name == "Kyle") ">
// Persons name is Kyle or Katie
\Person.name == "Kyle" || \Person.name == "Katie"

// Persons age is more than 25 and their name is Kyle
\Person.age >= 25 && \Person.name == "Kyle"

// Persons name is not Kyle
!(\Person.name == "Kyle")

Installation

CocoaPods is the recommended way to add QueryKit to your project, you may also use Carthage.

pod 'QueryKit'

License

QueryKit is released under the BSD license. See LICENSE.

Comments
  • Pods installation error

    Pods installation error

    I add QueryKit as a pod to project pod 'QueryKit', '~> 0.11'

    When I build it I get an error Pods/QueryKit/QueryKit/QueryKit.h:10:9: Include of non-modular header inside framework module 'QueryKit.QueryKit'

    screen shot 2015-11-03 at 11 12 13

    opened by kostiakoval 14
  • Xcode 6.3 / Swift 1.2 support

    Xcode 6.3 / Swift 1.2 support

    @kylef do you have plans to get the repo compatible with Xcode 6.3 / Swift 1.2? I've made some progress in a fork and it all seems straightforward except a few things with attributes.

    opened by robertjpayne 11
  • Predicates to compare to nil

    Predicates to compare to nil

    When I try to create a filter that excludes or includes nil values, I'm getting an error message:

    queryset.filter{ $0.configuration == nil }
    

    Type of expresion is ambiguous without more context

    If I try to create a predicate instead:

    let predicate = Widget.configuration == nil
    

    Value of type 'Attribute' can never be nil, comparison isn't allowed

    What am I doing wrong?

    opened by victor 10
  • Generic Attribute Class/Struct

    Generic Attribute Class/Struct

    Would this be useful at all? Adds some more type safety (agePredicateFailure gives an error: Could not find an overload for '==' that accepts the supplied arguments which isn't really the best).

    import CoreData
    
    @class_protocol protocol Attributable {
    }
    
    extension NSNumber: Attributable {
    }
    
    extension NSString: Attributable {
    }
    
    extension NSDate: Attributable {
    }
    
    struct Attribute<T: Attributable> {
    
        let name: String
    
        init(_ name: String) {
            self.name = name
        }
    
    }
    
    @infix func ==<T: Attributable> (left: Attribute<T>, right: T) -> NSPredicate {
        return NSPredicate(format: "%K == %@", argumentArray: [left.name, right])
    }
    
    let age = Attribute<NSNumber>("age")
    let name = Attribute<NSString>("name")
    let date = Attribute<NSDate>("date")
    
    let agePredicate = (age == 20)
    let agePredicateFailure = (age == "20")       // <-- Compile time error
    let namePredicate = (name == "Thomas")
    let datePredicate = (date == NSDate())
    
    println(agePredicate)  // age == 20
    println(namePredicate) // name == "Thomas"
    println(datePredicate) // date == CAST(426247727.711557, "NSDate")
    

    Using a @class_protocol and the objc versions of the types otherwise it complains about the argumentArray not being AnyObject[]. The compiler seems clever enough to be able to convert String and Int correctly when used this way though.

    It should work fine for the basic String, Number, Date (and possibly NSData) types but I'm not really sure about the transformable type. Biggest issue I see at the moment is that you still lose most of the safety when using numbers because you can't specify Boolean/Integer 16 etc.

    opened by tomguthrie 7
  • Swift dynamic cast failure

    Swift dynamic cast failure

    When I try to us the non NSPredicate notation I get an Swift dynamic cast failure.

    #1  0x0000000103153d7e in QueryKit.< infix <A>(QueryKit.Attribute<A>, A) -> ObjectiveC.NSPredicate at /Users/dirk/Development/Test_App/dummyDB/Pods/QueryKit/QueryKit/Attribute.swift:59
    

    Working code

    var predicate = NSPredicate(format: "age == 42")
    var qs2 = Person.queryset(moc).filter(predicate!)
    

    Error code

    var qs = Person.queryset(moc).filter(Person.attributes.age == 42)
    

    Model is

    Entity:Person
    Attribute:age::NSNumber
    Attribute:name::String
    

    Build with mogenerator template.

    bug 
    opened by dirkfabisch 4
  • get a error

    get a error "could not build Objective-C module 'QueryKit' " After upgrading xcode7

    /Pods/QueryKit/QueryKit/QueryKit.h:10:9: error: include of non-modular header inside framework module 'QueryKit.QueryKit'

    import <QueryKit/QKAttribute.h>

    /Pods/QueryKit/QueryKit/QueryKit.h:11:9: error: include of non-modular header inside framework module 'QueryKit.QueryKit'

    import <QueryKit/QKQuerySet.h>

        ^
    

    :0: error: could not build Objective-C module 'QueryKit'

    How to fix the error?

    opened by since66 3
  • Framework doesn't build using Carthage

    Framework doesn't build using Carthage

    There are currently issues using this framework with Carthage (i'm using 0.9.2, latest version):

    Here is the output of carthage build --verbose:

    Build settings from command line:
        ONLY_ACTIVE_ARCH = NO
        SDKROOT = watchsimulator2.0
    
    === BUILD TARGET QueryKit OF PROJECT QueryKit WITH CONFIGURATION Release ===
    
    Check dependencies
    No architectures to compile for (ARCHS=x86_64, VALID_ARCHS=armv7k).
    

    I get the same output even using --platform iOS flag to force compilation only for iOS.

    opened by alessandroorru 3
  • hello.What reason is this excuse me

    hello.What reason is this excuse me

       struct Attributes {
            var commGround:Attribute<String?> {
                return Attribute<String?>("commGround")
            }
            var createDateTime:Attribute<NSDate?> {
                return Attribute<NSDate?>("createDateTime")
            }
            var gender:Attribute<String?> {
                return Attribute<String?>("gender")
            }
            var headPhotoKey:Attribute<String?> {
                return Attribute<String?>("headPhotoKey")
            }
            var id:Attribute<String?> {
                return Attribute<String?>("id")
            }
            var name:Attribute<String?> {
                return Attribute<String?>("name")
            }
            var signature:Attribute<String?> {
                return Attribute<String?>("signature")
            }
            var sinaId:Attribute<String?> {
                return Attribute<String?>("sinaId")
            }
            var userBacks:Attribute<CoreDataUserBack?> {
                return Attribute<CoreDataUserBack?>("userBacks")
            }
            var userLabels:Attribute<CoreDataUserLabel?> {
                return Attribute<CoreDataUserLabel?>("userLabels")
            }
        }
    

    I used your mogenerator template,but When I use the provided by you queryset.filter(Person.attributes.name == "Kyle") It went wrong Binary operator '==' cannot be applied to operands of type 'Attribute<String?>' and 'String'

    this is myCode

            var quset = CoreDataUser.queryset(currageContext)
    
            quset.filter(CoreDataUser.attributes.id == "Kyle")
    

    Can you point out my mistakes, or repair it ?

    opened by 0x30 3
  • ¯\_(ツ)_/¯

    ¯\_(ツ)_/¯

    AppKit's NSObject (NSDictionaryControllerKeyValuePair) somehow messes with the key property of NSSortDescriptor. That seems to have no effect outside of the CP environment because the universal framework approach keeps AppKit out. Pretty hand-wavey 🌊,, but this works :)

    opened by neonichu 3
  • unsafeBitCast results in a EXC_BAD_INSTRUCTION on non 64 Bit device

    unsafeBitCast results in a EXC_BAD_INSTRUCTION on non 64 Bit device

    When I execute my QueryKit app on a non 64 bit device I get a EXC_BAD_INSTRUCTION at following code sample:

    var qs = Sensor.queryset(managedObjectContext).filter(
        Sensor.attributes.sensorStarted != 0 &&
        Sensor.attributes.sensorStopped == 0)
    

    In the QueryKit source code attributes.swift in line 50

            let value = unsafeBitCast(value, Optional<NSObject>.self)
    

    I get this error: fatal error: can't unsafeBitCast between types of different sizes Everything works as expected on 64 bit devices.

    bug 
    opened by dirkfabisch 3
  • Compatibility with Cocoapods 0.36.0.beta.2

    Compatibility with Cocoapods 0.36.0.beta.2

    Seems QueryKit doesn't like the latest beta of Cocoapods:

    Gemfile:

    source "https://rubygems.org"
    gem "cocoapods", "0.36.0.beta.2"
    

    Podfile:

    platform :ios, '8.0'
    pod 'QueryKit'
    

    Commands:

    bundle install
    bundle exec pod install
    xcodebuild -workspace <name>.xcworkspace -scheme <name>
    

    Output:

    The following build commands failed:
        Ld /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/armv7/QueryKit normal armv7
        Ld /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QueryKit normal arm64
        CreateUniversalBinary /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Products/Debug-iphoneos/Pods/QueryKit.framework/QueryKit normal armv7\ arm64
        GenerateDSYMFile /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Products/Debug-iphoneos/Pods/QueryKit.framework.dSYM /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Products/Debug-iphoneos/Pods/QueryKit.framework/QueryKit
        Ld /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/*****.build/Debug-iphoneos/*****.build/Objects-normal/armv7/***** normal armv7
        Ld /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/*****.build/Debug-iphoneos/*****.build/Objects-normal/arm64/***** normal arm64
        CreateUniversalBinary /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Products/Debug-iphoneos/*****.app/***** normal armv7\ arm64
        GenerateDSYMFile /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Products/Debug-iphoneos/*****.app.dSYM /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Products/Debug-iphoneos/*****.app/*****
        PhaseScriptExecution Embed\ Pods\ Frameworks /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/*****.build/Debug-iphoneos/*****.build/Script-9C71411E2A50EC258CF1F152.sh
        Ld /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/*****.build/Debug-iphoneos/*****Tests.build/Objects-normal/armv7/*****Tests normal armv7
        Ld /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/*****.build/Debug-iphoneos/*****Tests.build/Objects-normal/arm64/*****Tests normal arm64
        CreateUniversalBinary /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Products/Debug-iphoneos/*****Tests.xctest/*****Tests normal armv7\ arm64
        GenerateDSYMFile /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Products/Debug-iphoneos/*****Tests.xctest.dSYM /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Products/Debug-iphoneos/*****Tests.xctest/*****Tests
    

    Looking at the Pods build log:

    duplicate symbol _OBJC_IVAR_$_QKAttribute._name in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKAttribute-277787A4A92A1D6F.o
    duplicate symbol _OBJC_CLASS_$_QKAttribute in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKAttribute-277787A4A92A1D6F.o
    duplicate symbol _OBJC_METACLASS_$_QKAttribute in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKAttribute-277787A4A92A1D6F.o
    duplicate symbol _OBJC_IVAR_$_QKQuerySet._managedObjectContext in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKQuerySet-2C6DA287F3437EB3.o
    duplicate symbol _OBJC_IVAR_$_QKQuerySet._entityDescription in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKQuerySet-2C6DA287F3437EB3.o
    duplicate symbol _OBJC_IVAR_$_QKQuerySet._predicate in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKQuerySet-2C6DA287F3437EB3.o
    duplicate symbol _OBJC_IVAR_$_QKQuerySet._sortDescriptors in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKQuerySet-2C6DA287F3437EB3.o
    duplicate symbol _OBJC_IVAR_$_QKQuerySet._range in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKQuerySet-2C6DA287F3437EB3.o
    duplicate symbol _OBJC_IVAR_$_QKQuerySet._resultsCache in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKQuerySet-2C6DA287F3437EB3.o
    duplicate symbol _QKQuerySetErrorDomain in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKQuerySet-2C6DA287F3437EB3.o
    duplicate symbol _OBJC_CLASS_$_QKQuerySet in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKQuerySet-2C6DA287F3437EB3.o
    duplicate symbol _OBJC_METACLASS_$_QKQuerySet in:
        /Users/************/Library/Developer/Xcode/DerivedData/*****-annvlazmioqncwcrjreldnxhrmty/Build/Intermediates/Pods.build/Debug-iphoneos/Pods-QueryKit.build/Objects-normal/arm64/QKQuerySet-2C6DA287F3437EB3.o
    ld: 12 duplicate symbols for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    Looks like maybe just a double up on symbols? Unsure if this is related to QK or Cocoapods.

    bug 
    opened by robertjpayne 3
  • Is there anyway i can use QueryKit to solve the problem below

    Is there anyway i can use QueryKit to solve the problem below

    i want to find locations within a range based on some fields in the location model:

    The fields below are pre-calculated before the query.

        let CUR_cos_lat = cos(currenLocation.latitude * .pi / 180)
        let CUR_sin_lat = sin(currenLocation.latitude * .pi / 180)
        let CUR_cos_lng = cos(currenLocation.longitude * .pi / 180)
        let CUR_sin_lng = sin(currenLocation.longitude * .pi / 180)
        let cos_allowed_distance = cos(2.0 / 6371)
    

    i want to write a query like the below in Swift CoreData using NSPredicate:

    SELECT * FROM position WHERE CUR_sin_lat * sin_lat + CUR_cos_lat * cos_lat * (cos_lng* 
    CUR_cos_lng + sin_lng * CUR_sin_lng) > cos_allowed_distance;
    

    The fields below in the query above are already available in the CoreData model,

    1. sin_lat
    2. cos_lat
    3. cos_lng
    4. sin_lng
    5. cos_allowed_distance

    Link to Question on Stack : https://stackoverflow.com/questions/66634089/arithmetic-calculations-with-fields-of-coredata-models-with-nspredicate

    opened by yawboafo 0
  • Crash on unwrapping `_kvcKeyPathString` in `expression<R, V>(for keyPath: KeyPath<R, V>)`

    Crash on unwrapping `_kvcKeyPathString` in `expression(for keyPath: KeyPath)`

    I am hitting this crash on line 4 in KeyPath.swift. I guess we can assume the key path is valid or it would not have compiled so this is coming out of Swift.AnyKeyPath. I know there are issues reported out there about it, but I'm not sure what the solution is. Looking into it some more.

    Links

    https://bugs.swift.org/browse/SR-5220 https://bugs.swift.org/browse/SR-6270

    opened by johnclayton 3
  • Trying to query results in

    Trying to query results in "Value of type 'NSManagedObject' has no member 'entryId'" error

    let appdel = UIApplication.shared.delegate as! AppDelegate
    var viewContext: NSManagedObjectContext!
    var querysetEvents: QuerySet<Events>!
    
    // Query for entry with this ID
            for event in try! querysetContactEvents
            .filter(\.entryId == id)
            .array() {
                print(event.date)
            }
    

    results in

    "Value of type 'NSManagedObject' has no member 'entryId'"

    although entryId most certainly exists.

    Could you assist?

    opened by d0hnj0e 0
  • Can't perform Grouped By / Distinct

    Can't perform Grouped By / Distinct

    Hi Team, Kind of stuck here. Trying to do Grouped By or Distinct, but can't find any way using QueryKit. Can you help ? Thanks for your support Yannick

    opened by Yannick-91 2
Releases(0.14.0)
Owner
QueryKit
A simple CoreData query language for Swift and Objective-C.
QueryKit
A type-safe, fluent Swift library for working with Core Data

Core Data Query Interface (CDQI) is a type-safe, fluent, intuitive library for working with Core Data in Swift. CDQI tremendously reduces the amount o

null 31 Oct 26, 2022
JSON to Core Data and back. Swift Core Data Sync.

Notice: Sync was supported from it's creation back in 2014 until March 2021 Moving forward I won't be able to support this project since I'm no longer

Nes 2.5k Dec 31, 2022
Core Data Generator (CDG for short) is a framework for generation (using Sourcery) of Core Data entities from plain structs/classes/enums.

Core Data Generator Introduction Features Supported platforms Installation CDG Setup RepositoryType ModelType DataStoreVersion MigrationPolicy Basic U

Lotusflare 18 Sep 19, 2022
A minimalistic, thread safe, non-boilerplate and super easy to use version of Active Record on Core Data.

Skopelos A minimalistic, thread-safe, non-boilerplate and super easy to use version of Active Record on Core Data. Simply all you need for doing Core

Alberto De Bortoli 235 Sep 9, 2022
🎯 PredicateKit allows Swift developers to write expressive and type-safe predicates for CoreData using key-paths, comparisons and logical operators, literal values, and functions.

?? PredicateKit PredicateKit is an alternative to NSPredicate allowing you to write expressive and type-safe predicates for CoreData using key-paths,

Faiçal Tchirou 352 Jan 3, 2023
100% Swift Simple Boilerplate Free Core Data Stack. NSPersistentContainer

DATAStack helps you to alleviate the Core Data boilerplate. Now you can go to your AppDelegate remove all the Core Data related code and replace it wi

Nes 216 Jan 3, 2023
Super awesome Swift minion for Core Data (iOS, macOS, tvOS)

⚠️ Since this repository is going to be archived soon, I suggest migrating to NSPersistentContainer instead (available since iOS 10). For other conven

Marko Tadić 306 Sep 23, 2022
A powerful and elegant Core Data framework for Swift.

A powerful and elegant Core Data framework for Swift. Usage Beta version. New docs soon... Simple do that: let query = persistentContainer.viewContext

null 782 Nov 6, 2022
CloudCore is a framework that manages syncing between iCloud (CloudKit) and Core Data written on native Swift.

CloudCore CloudCore is a framework that manages syncing between iCloud (CloudKit) and Core Data written on native Swift. Features Leveraging NSPersist

deeje cooley 123 Dec 31, 2022
Unleashing the real power of Core Data with the elegance and safety of Swift

Unleashing the real power of Core Data with the elegance and safety of Swift Dependency managers Contact Swift 5.4: iOS 11+ / macOS 10.13+ / watchOS 4

John Estropia 3.7k Jan 9, 2023
JSQCoreDataKit - A swifter Core Data stack

JSQCoreDataKit A swifter Core Data stack About This library aims to do the following: Encode Core Data best practices, so you don't have to think "is

Jesse Squires 596 Dec 3, 2022
JustPersist is the easiest and safest way to do persistence on iOS with Core Data support out of the box.

JustPersist JustPersist is the easiest and safest way to do persistence on iOS with Core Data support out of the box. It also allows you to migrate to

Just Eat 167 Mar 13, 2022
HitList is a Swift App shows the implementation of Core Data.

HitList HitList is a Swift App shows the implementation of Core Data. It is the demo app of Ray Wenderlich's tech blog. For details please reference G

Kushal Shingote 2 Dec 9, 2022
A synchronization framework for Core Data.

Core Data Ensembles Author: Drew McCormack Created: 29th September, 2013 Last Updated: 15th February, 2017 Ensembles 2 is now available for purchase a

Drew McCormack 1.6k Dec 6, 2022
Core Data code generation

mogenerator Visit the project's pretty homepage. Here's mogenerator's elevator pitch: mogenerator is a command-line tool that, given an .xcdatamodel f

Wolf Rentzsch 3k Dec 30, 2022
Super Awesome Easy Fetching for Core Data!

MagicalRecord In software engineering, the active record pattern is a design pattern found in software that stores its data in relational databases. I

Magical Panda Software 10.9k Dec 29, 2022
A feature-light wrapper around Core Data that simplifies common database operations.

Introduction Core Data Dandy is a feature-light wrapper around Core Data that simplifies common database operations. Feature summary Initializes and m

Fuzz Productions 33 May 11, 2022
The Big Nerd Ranch Core Data Stack

BNR Core Data Stack The BNR Core Data Stack is a small Swift framework that makes it both easier and safer to use Core Data. A better fetched results

Big Nerd Ranch 561 Jul 29, 2022
Example repo of working with Core Data in a SwiftUI application

CoreData in SwiftUI This repository serves many purpose. But mostly so I can experiment with Core Data in SwiftUI, and also so I can use it show my ap

Donny Wals 4 Jan 30, 2022