CoreData/Realm sweet wrapper written in Swift

Related tags

SugarRecord
Overview

SugarRecord

Twitter: @carambalabs CocoaPods Compatible Language: Swift Language: Swift Build Status Carthage Compatible

What is SugarRecord?

SugarRecord is a persistence wrapper designed to make working with persistence solutions like CoreData in a much easier way. Thanks to SugarRecord you'll be able to use CoreData with just a few lines of code: Just choose your stack and start playing with your data.

The library is maintained by @carambalabs. You can reach me at [email protected] for help or whatever you need to commend about the library.

paypal

Features

  • Swift 3.0 compatible (Xcode 8.0).
  • Protocols based design.
  • For beginners and advanced users
  • Fully customizable. Build your own stack!
  • Friendly syntax (fluent)
  • Away from Singleton patterns! No shared states 🎉
  • Compatible with OSX/iOS/watchOS/tvOS
  • Fully tested (thanks Nimble and Quick)
  • Actively supported

Setup

CocoaPods

  1. Install CocoaPods. You can do it with gem install cocoapods
  2. Edit your Podfile file and add the following line pod 'SugarRecord'
  3. Update your pods with the command pod install
  4. Open the project from the generated workspace (.xcworkspace file).

Note: You can also test the last commits by specifying it directly in the Podfile line

Available specs Choose the right one depending ton the configuration you need for you app.

pod "SugarRecord/CoreData"
pod "SugarRecord/CoreData+iCloud"

Carthage

  1. Install Carthage. You can do it with brew install carthage.
  2. Edit your Cartfile file and add the following line `github "carambalabs/sugarrecord".
  3. Execute carthage update
  4. Add the frameworks to your project as explained on the Carthage repository.

Reference

You can check generated SugarRecord documentation here generated automatically with CocoaDocs

How to use

Creating your Storage

A storage represents your database. The first step to start using SugarRecord is initializing the storage. SugarRecord provides a default storages, CoreDataDefaultStorage.

// Initializing CoreDataDefaultStorage
func coreDataStorage() -> CoreDataDefaultStorage {
    let store = CoreDataStore.named("db")
    let bundle = Bundle(for: self.classForCoder)
    let model = CoreDataObjectModel.merged([bundle])
    let defaultStorage = try! CoreDataDefaultStorage(store: store, model: model)
    return defaultStorage
}
Creating an iCloud Storage

SugarRecord supports the integration of CoreData with iCloud. It's very easy to setup since it's implemented in its own storage that you can use from your app, CoreDataiCloudStorage:

// Initializes the CoreDataiCloudStorage
func icloudStorage() -> CoreDataiCloudStorage {
    let bundle = Bundle(for: self.classForCoder)
    let model = CoreDataObjectModel.merged([bundle])
    let icloudConfig = CoreDataiCloudConfig(ubiquitousContentName: "MyDb", ubiquitousContentURL: "Path/", ubiquitousContainerIdentifier: "com.company.MyApp.anothercontainer")
    let icloudStorage = try! CoreDataiCloudStorage(model: model, iCloud: icloudConfig)
    return icloudStorage
}

Contexts

Storages offer multiple kind of contexts that are the entry points to the database. For curious developers, in case of CoreData a context is a wrapper around NSManagedObjectContext. The available contexts are:

  • MainContext: Use it for main thread operations, for example fetches whose data will be presented in the UI.
  • SaveContext: Use this context for background operations. The context is initialized when the storage instance is created. That context is used for storage operations.
  • MemoryContext: Use this context when you want to do some tests and you don't want your changes to be persisted.

Fetching data

let pedros: [Person] = try! db.fetch(FetchRequest<Person>().filtered(with: "name", equalTo: "Pedro"))
let tasks: [Task] = try! db.fetch(FetchRequest<Task>())
let citiesByName: [City] = try! db.fetch(FetchRequest<City>().sorted(with: "name", ascending: true))
let predicate: NSPredicate = NSPredicate(format: "id == %@", "AAAA")
let john: User? = try! db.fetch(FetchRequest<User>().filtered(with: predicate)).first

Remove/Insert/Update operations

Although Contexts offer insertion and deletion methods that you can use it directly SugarRecords aims at using the operation method method provided by the storage for operations that imply modifications of the database models:

  • Context: You can use it for fetching, inserting, deleting. Whatever you need to do with your data.
  • Save: All the changes you apply to that context are in a memory state unless you call the save() method. That method will persist the changes to your store and propagate them across all the available contexts.
do {
  db.operation { (context, save) throws in
    // Do your operations here
    try save()
  }
} catch {
  // There was an error in the operation
}
New model

You can use the context new() method to initialize a model without inserting it in the context:

do {
  db.operation { (context, save) throws in
    let newTask: Track = try context.new()
    newTask.name = "Make CoreData easier!"
    try context.insert(newTask)
    try save()
  }
} catch {
  // There was an error in the operation
}

In order to insert the model into the context you use the insert() method.

Creating a model

You can use the create() for initializing and inserting in the context in the same operation:

do {
  db.operation { (context, save) throws -> Void in
    let newTask: Track = try! context.create()
    newTask.name = "Make CoreData easier!"
    save()
  }
}
catch {
  // There was an error in the operation
}
Delete a model

In a similar way you can use the remove() method from the context passing the objects you want to remove from the database:

do {
  db.operation { (context, save) throws in
    let john: User? = try context.request(User.self).filteredWith("id", equalTo: "1234").fetch().first
    if let john = john {
      try context.remove([john])
      try save()
    }
  }
} catch {
  // There was an error in the operation
}

> This is the first approach of SugarRecord for the interface. We'll improve it with the feedback you can report and according to the use of the framework. Do not hesitate to reach us with your proposals. Everything that has to be with making the use of CoreData easier, funnier, and enjoyable is welcome! 🎉

RequestObservable

SugarRecord provides a component, RequestObservable that allows observing changes in the DataBase. It uses NSFetchedResultsController under the hood.

Observing

class Presenter {
  var observable: RequestObservable<Track>!

  func setup() {
      let request: FetchRequest<Track> = FetchRequest<Track>().filtered(with: "artist", equalTo: "pedro")
      self.observable = storage.instance.observable(request)
      self.observable.observe { changes in
        case .Initial(let objects):
          print("\(objects.count) objects in the database")
        case .Update(let deletions, let insertions, let modifications):
          print("\(deletions.count) deleted | \(insertions.count) inserted | \(modifications.count) modified")
        case .Error(let error):
          print("Something went wrong")
      }
  }
}

Retain: RequestObservable must be retained during the observation lifecycle. When the RequestObservable instance gets released from memory it stops observing changes from your storage.

NOTE: This was renamed from Observable -> RequestObservable so we are no longer stomping on the RxSwift Observable namespace.

⚠️ RequestObservable is only available for CoreData + OSX since MacOS 10.12

Resources

Contributors

glebosushichopfoxlingZevEisenbergkonyu

yuuki1224YTN01gitter-badgersergigraciaadityatrivedi

Adlai-Hollerakshaynhegdegoingreenstartupthekidctotheameron

davidahouseA8-MokeArasthelLuizZakliterator

madeinqckoliskodukemikerafalwojcikthad

chrispixReadmeCriticavielgrdougangrangej

fjbelchidcvzpepibumur

About

This project is funded and maintained by Caramba. We 💛 open source software!

Check out our other open source projects, read our blog or say 👋 on twitter @carambalabs.

Contribute

Contributions are welcome 🤘 We encourage developers like you to help us improve the projects we've shared with the community. Please see the Contributing Guide and the Code of Conduct.

License

The MIT License (MIT)

Copyright (c) 2017 Caramba

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.

Issues
  • The `SugarRecord-iOS [Debug]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT`

    The `SugarRecord-iOS [Debug]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT`

    Hi, awesome this is such a great API. Though I'm getting this error when trying to install the pod I've added: pod 'SugarRecord', :git => 'https://github.com/gitdoapp/sugarrecord.git' to the pod file though the error happens below. I've tried adding $(inherited) to: Header Search Paths Other Linker Flags Preprocessor Macros in Project -> Target -> Build Settings Though still the same error. Thanks in advance if you can help. /********************************************/ [!] The SugarRecord-iOS [Debug] target overrides the EMBEDDED_CONTENT_CONTAINS_SWIFT build setting defined in Pods/Target Support Files/Pods-SugarRecord-iOS/Pods-SugarRecord-iOS.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the$(inherited)` flag, or - Remove the build settings from the target.

    opened by Ged2323 15
  • unable to install sugarrecord as submodule

    unable to install sugarrecord as submodule

    I'm trying to setup my project to use sugarrecord as a submodule but i am unable to get the application to compile.

    I want to use CoreData and RestKit, and I followed your instructions on the wiki, but it keeps saying builds fails (no error) i'm not sure what i'm doing wrong.

    do you have example application that has sugarrecord imported as a submodule?

    opened by eschan 14
  • RestKit Integration Guide

    RestKit Integration Guide

    I would love to be able to integrate with Restkit. there's already a few examples of how to integrate MagicalRecord with RestKit

    see: https://github.com/m1entus/MZFlickrMania/blob/master/FlickrMania/MZAppDelegate.m#L40-L57

    https://github.com/RestKit/RKGist/blob/master/TUTORIAL.md#configuring-restkit--core-data https://github.com/magicalpanda/MagicalRecord/blob/develop/Docs/GettingStarted.md

    also, do you guys think they will work well together?

    opened by yelled3 13
  • How to manually call the save method?

    How to manually call the save method?

    I found that when i call model.save() or model.endWriting(), they are not save to database. Sometimes , I want to manually call the save method to save data immediately in database. like:

    [MagicalRecord saveUsingCurrentThreadContextWithBlockAndWait:nil];
    
    opened by foxling 13
  • Test

    Test

    asgassasa

    opened by gitdoer 13
  • Single quote the string predicates on the finder and consider other types

    Single quote the string predicates on the finder and consider other types

    What?

    • Commented here: https://github.com/SugarRecord/SugarRecord/pull/87#issuecomment-67567564 Just how we have implemented the finder if you want to filter using an string you have to single-quote it which is something most of users forget about.
    • We could split the by() method into: by(name: String, stringValue: String) by(name: String, intValue: String)

    Steps

    • [ ] Add methods to the SugarRecordObjectProtocol
    • [ ] Add methods to the Finder
    • [ ] Test SugarRecord objects methods:
      • [ ] Objective-C
      • [ ] Realm
    • [ ] Teste SugarRecordFinder methods: Note: Basically the tests would consist on checking if the predicate has the right format
    opened by pepibumur 11
  • Observer.OnNext / Operation generic functions

    Observer.OnNext / Operation generic functions

    This will supersede the previous pull request , I will close the other pull request.

    opened by grangej 11
  • Extra Argument 'equalTo:' issue

    Extra Argument 'equalTo:' issue

    Why won't this compile:

    if let extId:NSNumber = subJson["id"].number{

    ==> error here: let category: Categorization? = Categorization.by("extID", equalTo: extId).find()?.first as Categorization?

    opened by jimijon 10
  • Add RestKit sample to example

    Add RestKit sample to example

    What?

    Adds RestKit sample to the example project Resolves part of https://github.com/SugarRecord/SugarRecord/issues/69

    What should be tested?

    • CocoaPods
    • RestKit view controller

    What tasks are remaining?

    • [x] Add CocoaPods to the project
    • [x] Add RestKit view controller
    opened by rdougan 9
  • iCould support

    iCould support

    Which iOS version for iCloud is supported iOS 7, iOS 8 or both. And is there some specific steps to add iCloud support different from just change the CoreDataStack and enable iCloud?

    opened by aatanosv-appolica 9
  • Swift 5 and build fixes

    Swift 5 and build fixes

    A pull request from a fork by @aporat that does work on Swift 5 and Xcode 11.x.

    Anyone can use it with pod 'SugarRecord', :git => 'https://github.com/aporat/SugarRecord.git'.

    opened by rivera-ernesto 0
  • how to update an record ?

    how to update an record ?

    What

    Well I want to update an record which is already inserted.

    Context

    I'm saving records in the database. For example I saved data in db at 1:50 PM and now I sync app at 2:50 PM and want to update the same records , but It do Insert of new record. I tried finding the update function but no success

    opened by patriksharma 0
  • App Crashes when using observable

    App Crashes when using observable

    What

    Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An instance of NSFetchedResultsController requires a fetch request with sort descriptors'

    Context

    let request : FetchRequest<DataObject> = FetchRequest<DataObject>()
        
                    self.observable = db.observable(request: request)
                    
                    pedometerDataObservable.observe { (changes) in
                        switch changes {
    
                        case .initial(let objects):
                            print("\(objects.count) objects in the database")
                        case .update(let deletions, let insertions, let modifications):
                            print("\(deletions.count) deleted | \(insertions.count) inserted | \(modifications.count) modified")
                        case .error(let error):
                            print("Something went wrong", error.localizedDescription)
                        }
                    }
    
    opened by firecrackerz 1
  • Taking CoreData operations off main thread

    Taking CoreData operations off main thread

    Hello guys!

    What

    According to best practices, it is better to do Coredata related operations in the background, not to cause any possible performance drops, or UI blocks

    I feel like you are doing some database access in the main thread:

    Context

    Class: CoreDataObservable, function:observe, and Class:CoreDataDefaultStorageTests function:spec, both calling fetch which is doing database operations

    Proposal

    Don't you think it would be better to take these operations off the main thread?

    opened by saraseif 0
  • Can you adapter Swift 4.1

    Can you adapter Swift 4.1

    What

    Describe here your issue, a bug you found, an idea that you had, something that you think can be improved...

    Context

    Provide information that helps with understanding your issue. For example your use case that the project doesn't cover, what you were doing when you found the bug... You can also provide the version of the library that you were using, how you integrated it with your project, the platform version...

    Proposal

    Attach your own proposal (if you have it). We'll discuss in on the issue to find the best one that fits into the library.

    opened by andanyoung 0
  • iOS Carthage build fails with Swift 4.1

    iOS Carthage build fails with Swift 4.1

    What

    After updating to Xcode 9.3 (9E145) and Swift 4.1, an iOS project that depends on SugarRecord 3.1.3 fails to build. Carthage reports a compile error in CoreDataObservable.swift:

    <unknown>:0: error: unable to execute command: Segmentation fault: 11
    
    	/usr/bin/xcrun xcodebuild -workspace /Users/goleinik/Workspaces/***/iOS/Carthage/Checkouts/SugarRecord/SugarRecord.xcworkspace -scheme iOSCoreData -configuration Debug -derivedDataPath /Users/goleinik/Workspaces/***/iOS/Carthage/Build/DerivedData/9.3_9E145/SugarRecord/db21b8b2a568193600ce011d682c3bb6031864fc -sdk iphonesimulator -destination platform=iOS\ Simulator,id=7AFE625D-6C2C-4A03-BD51-706FDB1F0A16 -destination-timeout 3 ONLY_ACTIVE_ARCH=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES build (launched in /Users/goleinik/Workspaces/***/iOS/Carthage/Checkouts/SugarRecord)
    

    Context

    Sugar Record Release 3.1.3 Carthage Version: 0.29.0 OSX 10.13.4 Xcode 9.3 (9E145) Swift 4.1 Base SDK iOS 11.3

    opened by glebo 0
  • Development Pods / Frameworks  Support

    Development Pods / Frameworks Support

    What

    Support for third part frameworks, like Core functionalities, etc

    Context

    CoreDataGenerated entity files is not visible for apps working with frameworks using SugarRecord as dependency.

    opened by ernesto 0
  • pod install on Example project fails

    pod install on Example project fails

    What

    Running pod install on the Example project fails

    Context

    I downloaded the SugarRecord project as a zip and tried to run pod install in the Example project. It fails with the following error.

    Could not find proper version of cocoapods (1.1.0.rc.2) in any of the sources

    My installed CocoaPods version is v1.2.1.

    opened by Isuru-Nanayakkara 0
  • Adding Count operation to Context

    Adding Count operation to Context

    Short description

    Adds a method Context.count<T> and implement it in the NSManagedObjectContext extension.

    Solution

    Counting number of results without getting the objects is a useful functionality, specially when the objects are heavy-weight to fetch simply to be counted and then discarded.

    Implementation

    • [√] Add new protocol method Context.count<T: Entity>(_:) throws -> Int;
    • [√] Implement this protocol on existing extension of NSManagedObjectContext with other protocol requirements.

    GIF

    CoreData with brand new count method:

    200

    ...that gives 02 (two) UserEntity instances.

    opened by LuizZak 0
  • The update operation doesn't work

    The update operation doesn't work

    What

    when I update the entity first it works , but it failed when I update it again with different data;

    Context

    Here is my code: // I called flowed function first , and it worked when I restart my app.

    static func storeAuth(
            grantType:String,
            clientId:Int16,
            clientSecret:String
            ) -> Bool{
            let auth = self.getUserAuth();
            if auth == nil{
                do{
                    try AppUser.db.operation({ (context, save) throws in
                        let auth:UserAuth = try context.new();
                        auth.grantType = grantType;
                        auth.clientId = clientId;
                        auth.clientSecret = clientSecret
                        try context.insert(auth)
                        save()
                    })
                    return true
                }catch{
                    debugPrint(error.localizedDescription)
                    return false;
                }
            }else{
                do{
                    try AppUser.db.operation({ (context, save) throws in
                        auth?.grantType = grantType;
                        auth?.clientId = clientId;
                        auth?.clientSecret = clientSecret
                        save()
                    })
                    return true;
                }catch{
                    debugPrint(error.localizedDescription)
                    return false;
                }
            }
        }
    
    

    // and I call this function to update it again, but when I restart my app, the updated data was not stored. the data was that updated before;

    static func updateAuthToken(expiresIn:Int,
                                    refreshToken:String,
                                    tokenType:String,
                                    accessToken:String){
            let auth = self.getUserAuth();
            if auth != nil{
                do{
                    try AppUser.db.operation({ (context, save) throws in
                        auth?.tokenExpiredAt = NSDate().addingSeconds(expiresIn) as NSDate?
                        auth?.refreshToken = refreshToken
                        auth?.tokenType = tokenType
                        auth?.accessToken = accessToken
                        save()
                    })
                }catch{
                    debugPrint(error.localizedDescription)
                }
            }
        }
    
    opened by wugang8068 0
Releases(3.1.3)
  • 3.1.3(May 8, 2017)

  • 3.1.2(Apr 9, 2017)

    Bump podspec to 3.1.2 Add backgroundOperation method to the storage (#325)

    • [background-operation] Add backgroundOperation method to the storage

    • [background-operation] Fix unit tests

    • [background-operation] Add tests to backgroundOperation

    • [background-operation] Remove realm from storage type Update deprecated syntax on the README file Bump podspec to 3.1.1 Update Bundle dependencies Remove Realm support

    Source code(tar.gz)
    Source code(zip)
  • 3.1.1(Apr 7, 2017)

  • 3.0.3(Mar 23, 2017)

  • 3.0.2(Mar 23, 2017)

  • 3.0.1(Mar 23, 2017)

    Bump podspec to 3.0.1 Updated the github URL that's being called to use HTTPS (#314)

    Use the right NSFetchedResultsControllerDelegate method. Fix for Delegate method not being called. (CoreDataObservable with no informations #307) (#310)

    fixed documents directory for tvOS (#309)

    Implement tests for the new Request methods Add filteredWith IN and NOT IN (#305)

    • fiteredWith IN and NOT IN added

    • Update Request.swift Bump version to 3.0.0 Bump podspec to 3.0.1

    Source code(tar.gz)
    Source code(zip)
  • 3.0.0(Oct 10, 2016)

  • 3.0.0-alpha.2(Sep 28, 2016)

  • 3.0.0-alpha.1(Sep 20, 2016)

  • 2.3.1(Aug 31, 2016)

    Bump podspec to 2.3.1 Add danger Add tests again Update README with caramba info Updated podspec info Bump Realm version Fix esamples Fix a few things in the README Merge pull request #272 from carambalabs/remove-rx-carthage Remove Reactive framework and Carthage Create tests target Update pods Remove Carthage project and Reactive references in the README file Remove Carthage, Rx and ReactiveCocoa Create .pullapprove.yml Update README Add files via upload Update Cartifle.resolved Merge pull request #270 from dukemike/issues/269 only perform version checks on debug builds. refs #269 only perform version checks on debug builds. refs #269

    Source code(tar.gz)
    Source code(zip)
  • 2.2.9(Jun 28, 2016)

    • Remove Embedded Content Contains Swift Code https://github.com/pepibumur/SugarRecord/pull/260 (thanks @grangej )
    • Modify observers to allow returning data https://github.com/pepibumur/SugarRecord/pull/257 (thanks @grangej)
    • Version checker https://github.com/pepibumur/SugarRecord/pull/244
    • Rename Observable https://github.com/pepibumur/SugarRecord/pull/256
    Source code(tar.gz)
    Source code(zip)
  • 2.2.8(May 16, 2016)

    • Observable improvements. The new interface now returns the elements that have changed with the indexes.
    • Created Slack community that developers can join to. https://github.com/pepibumur/SugarRecord/commit/30ddb1dd0ee405bf82834b5fd014204120dc73c0
    • Update Realm to 0.102.1 https://github.com/pepibumur/SugarRecord/commit/60360a0c14d025e3a0755f71e0a558644a66ed23
    • Update RxSwift to 2.5.0 https://github.com/pepibumur/SugarRecord/commit/60360a0c14d025e3a0755f71e0a558644a66ed23
    • Add Observable examples to the Example project.
    • Fix a bug disposing the CoreData Observable https://github.com/pepibumur/SugarRecord/commit/b148bbe6ec293caf95adb13164aaa782c220ab66 (Thanks @grangej)
    Source code(tar.gz)
    Source code(zip)
  • 2.2.7(May 8, 2016)

  • 2.2.4(Apr 5, 2016)

  • 2.2.3(Mar 30, 2016)

    • SugarRecord supports now Xcode 7.3
    • Added removeAll method to Context to remove all the entities. It's only available for Realm. Fixes https://github.com/pepibumur/SugarRecord/issues/219
    • Moved the rootSavingContext saving operation into a performBlockAndWait() block. Fixes https://github.com/pepibumur/SugarRecord/issues/212
    • Made entityName attribute a class attribute. Fixes https://github.com/pepibumur/SugarRecord/issues/206
    • Errors are now exposed in operations. Fixes https://github.com/pepibumur/SugarRecord/issues/204
    • Improvements in the reactive interface. Fixes https://github.com/pepibumur/SugarRecord/issues/216
    Source code(tar.gz)
    Source code(zip)
  • 2.2.2(Feb 7, 2016)

  • 2.2.1(Feb 3, 2016)

    This new version includes a new CoreDataStack with iCloud support. The list of CocoaPods subspecs has been updated:

    pod "SugarRecord/CoreData"
    pod "SugarRecord/CoreData+iCloud"
    pod "SugarRecord/CoreData+RX"
    pod "SugarRecord/CoreData+RX+iCloud"
    pod "SugarRecord/CoreData+RAC"
    pod "SugarRecord/CoreData+RAC+iCloud"
    pod "SugarRecord/Ream"
    pod "SugarRecord/Realm+RX"
    pod "SugarRecord/Realm+RAC"
    
    Source code(tar.gz)
    Source code(zip)
    SugarRecordCoreData.framework.zip(22.29 MB)
    SugarRecordRealm.framework.zip(20.94 MB)
  • 2.1.8(Jan 23, 2016)

  • 2.1.7(Jan 14, 2016)

  • 2.1.6(Jan 2, 2016)

  • 2.1.4(Dec 26, 2015)

  • 2.1.3(Dec 21, 2015)

  • 2.1.2(Dec 20, 2015)

  • 2.1.1(Dec 18, 2015)

    • Added Realm 0.97 version. That version includes:
      • Support for tvOS. You can use now SugarRecord+Realm with your tvOS.
      • Better integration with Carthage. Installing SugarRecord+Realm should be faster now.
    • Improved Carthage integration. Now each platform has two schemes, SugarRecordRealm & SugarRecordCoreData. Drag only the one you need in your app plus Realm in case you are using the Realm integration.
    Source code(tar.gz)
    Source code(zip)
    SugarRecord.framework.zip(22.68 MB)
  • 2.1.0(Dec 13, 2015)

    • Removed Result dependency from context methods. Methods throw now instead of returning a Result object wrapping Error and Values.
    • Reviewed the interface of Context to make it similar to Realm's one: add, create, new, fetch, remove.
    • Removed asynchrony from from operation methods in storage. Asynchrony has to be handled externally now (Realm inspired).
    • Added LICENSE file.
    • Added fetch method to Storage using internally the main context for fetching.
    • Implemented a Reactive API in Storage:
    func rac_operation(operation: (context: Context, save: Saver) -> Void) -> SignalProducer<Void, NoError>
    func rac_backgroundOperation(operation: (context: Context, save: Saver) -> Void) -> SignalProducer<Void, NoError>
    func rac_backgroundFetch<T, U>(request: Request<T>, mapper: T -> U) -> SignalProducer<[U], Error>
    func rac_fetch<T>(request: Request<T>) -> SignalProducer<[T], Error>
    
    Source code(tar.gz)
    Source code(zip)
    SugarRecord.framework.zip(22.68 MB)
  • 2.0.1(Dec 8, 2015)

  • 1.0.7(Jan 17, 2015)

    • Some private methods made public: https://github.com/SugarRecord/SugarRecord/pull/106
    • Typo mistake: https://github.com/SugarRecord/SugarRecord/pull/107
    Source code(tar.gz)
    Source code(zip)
  • 1.0.6(Jan 2, 2015)

    • Fixed autosaving feature on DefaultCDStack
    • Use of printable instead of StringLiteralConvertible
    • Reviewed the CI script (still not working travis :( )
    Source code(tar.gz)
    Source code(zip)
  • 1.0.5(Dec 28, 2014)

  • 1.0.4(Dec 25, 2014)

    • Logging improved
    • Added a continuous integration script bash ci.sh
    • Added a Realm example to the example project
    • Added CocoaPods experimental support
    • Improved the count method to avoid unnecessary fetching. By @twobitlabs
    • Renamed entityName to modelName to avoid conflicts
    • Finder methods refactored to use StringLiteral instead of String
    • Added RestKit example to the example project
    • Added SugarRecordResults type as a Query result type (Inspired on Realm)
    Source code(tar.gz)
    Source code(zip)
Owner
Modo
We are Modo, a remote digital product studio
Modo
CoreData/Realm sweet wrapper written in Swift

What is SugarRecord? SugarRecord is a persistence wrapper designed to make working with persistence solutions like CoreData in a much easier way. Than

Modo 2.1k Aug 18, 2021
Unrealm is an extension on RealmCocoa, which enables Swift native types to be saved in Realm.

Unrealm enables you to easily store Swift native Classes, Structs and Enums into Realm . Stop inheriting from Object! Go for Protocol-Oriented program

Artur  Mkrtchyan 459 Sep 14, 2021
A library that provides the ability to import/export Realm files from a variety of data container formats.

Realm Converter Realm Converter is an open source software utility framework to make it easier to get data both in and out of Realm. It has been built

Realm 204 Jul 28, 2021
Sync Realm Database with CloudKit

IceCream helps you sync Realm Database with CloudKit. It works like magic! Features Realm Database Off-line First Thread Safety Reactive Programming O

Soledad 1.6k Sep 18, 2021
A type-safe, Swift-language layer over SQLite3.

SQLite.swift A type-safe, Swift-language layer over SQLite3. SQLite.swift provides compile-time confidence in SQL statement syntax and intent. Feature

Stephen Celis 7.8k Sep 16, 2021
A Cocoa / Objective-C wrapper around SQLite

FMDB v2.7 This is an Objective-C wrapper around SQLite. The FMDB Mailing List: https://groups.google.com/group/fmdb Read the SQLite FAQ: https://www.s

August 13.6k Sep 21, 2021
Native MongoDB driver for Swift, written in Swift

Installation | Tutorial | Basic usage | About BSON | Codable | Community | How to help A fast, pure swift MongoDB driver based on Swift NIO built for

null 617 Sep 20, 2021
YapDB is a collection/key/value store with a plugin architecture. It's built atop sqlite, for Swift & objective-c developers.

YapDatabase is a collection/key/value store and so much more. It's built atop sqlite, for Swift & Objective-C developers, targeting macOS, iOS, tvOS &

Yap Studios 3.3k Sep 14, 2021
The easiest way to get started with PostgreSQL on the Mac

Postgres.app The easiest way to run PostgreSQL on your Mac Includes everything you need to get started with PostgreSQL Comes with a pretty GUI to star

Postgres.app 6k Sep 23, 2021
Open source PostgreSQL GUI client for macOS, Linux and Windows

Postbird Postbird is a cross-platform PostgreSQL GUI client, written in JavaScript, runs with Electron Download Version 0.8.4 MacOS: Postbird-0.8.4.dm

Pavel Evstigneev 1.2k Sep 21, 2021
Native cross-platform MongoDB management tool

About Robo 3T Robo 3T (formerly Robomongo *) is a shell-centric cross-platform MongoDB management tool. Unlike most other MongoDB admin UI tools, Robo

Studio 3T 8.7k Sep 23, 2021
MySQL/MariaDB database management for macOS

Sequel Pro Sequel Pro is a fast, easy-to-use Mac database management application for working with MySQL & MariaDB databases. You can find more details

Sequel Pro 8.5k Sep 19, 2021
The easiest way to get started with MongoDB on the Mac

mongoDB.app The easiest way to get started with mongoDB on the Mac. Just download, drag to the applications folder, and double-click. Download Version

Giovanni Collazo 472 Sep 16, 2021