Giter Club home page Giter Club logo

sugarrecord's Introduction

xcres

![Gitter](https://badges.gitter.im/Join Chat.svg)

Twitter: @pepibumur Language: Swift Build Status Language: Swift

What is SugarRecord?

SugarRecord is a management library to make it easier work with CoreData and REALM. Thanks to SugarRecord you'll be able to start working with CoreData/REALM with just a few lines of code:

  1. Choose your preferred stack among the available ones (You can even propose your own!)
  2. Enjoy with your database operations

The library is completetly written in Swift and fully tested to ensure the behaviour is the expected one.

There's a Google Group where you can leave your topics, question, doubts, suggestions and stuff besides issues https://groups.google.com/forum/#!forum/sugarrecord .

Moreover we have a blog to talk about the library, check it here: http://www.sugarrecord.com/

Powered by @pepibumur

image The scheme above shows the structure of SugarRecord. It's formed by:

  • Database Models Extensions: To add the sugar syntax that links these models with SugarRecord and the database.
  • Finder: SugarRecord custom element to abstract the querying components from the type of storage (Realm or CoreData)
  • Core: Main component of the library that translates Save/Delete/Find calls into internal operations using the stacks set.
  • SugarRecord contexts: Altough Realm doesn't have contexts as we have in CoreData, we have created abstracted contexts that surround the user operations with models independently if you are using CoreData or Realm. Yeah!
  • Stack: The storage stack is another key piece in SugarRecord because it knows how and when persist/fetch/delete your objects into the database. You can tell SugarRecord which stack it should use.

Mailing list

If you want to stay updated we have a mailing list. We'll send emails with new updates, features, important bugs fixed, ...

image

Updates

Date Done
21th-November-2014 Closed the issue related with RestKit dependency
21th-November-2014 Filled the Wiki page covering existing features
21th-November-2014 Added AutoSaving feature to CoreData stacks
16th-November-2014 Added cancelWriting feature PR
16th-October-2014 Finished stack for iCloud PR
6th-October-2014 Added FetchedResultsController support PR
5th-October-2014 Writen a post about custom operators, POST
5th-October-2014 Added custom operators
5th-October-2014 Created playground tutorial
5th-October-2014 Added count methods PR
4th-October-2014 Added migrations support Pull Request
30th-September-2014 Added first post to the new blog SugarRecord

Index

Features

  • For beginners and advanced users
  • Fully customizable. Implement your own stack and set it as your SugarRecord stack to work with.
  • Friendly syntax. Forget about NSPredicates and NSSortDescriptors
  • You can change between different stacks without affecting to the rest of your app.
  • In case of a transition from CoreData to Realm or viceversa you've only to ensure the objecs have the same property names, and nothing more.
  • Background operations are automatically managed by Sugar Record
  • Support for Realm and CoreData using the same syntax
  • Multiple stacks (for Realm, CoreData, CoreData+iCloud)
  • Sugar syntax, forget about complicated lines of code to fetch your last 20 users!
  • Written 100% in Swift and compatible with Swift projects (in case of Objective-C a wrapper is needed)
  • Compatible with OSX and iOS
  • Fully documented with a playground tutorial and an updated Wiki page
  • Fully tested (all components are tested using XCTest)
  • Actively supported, issues covered in less than a week.
  • More powerful features to discover!

Versions

Version 1.0.2 Beta - Features

  • Updated the project structure to package the libary in bundles
  • Added cancelWriting() feature
  • Filled the Wiki page of the project
  • Added autoSaving property for CoreData stacks

Version 1.0.1 Beta - Features

  • Playground tutorial to learn how to use SugaRecord
  • Migrations support
  • Count methods
CoreDataObject.all().count()
  • Swift custom operators
var person = context <- Person.self // Object creation in a given context
var person = Person.self++ // Object creation in the default context
Person.self += person // Object saving
Person.self -= person // Object deletion
  • FetchedResultsController support
CoreDataObject.all().fetchedResultsController("name")
  • Stack for iCloud

Version 1.0 Beta - Features

  • 100% Unit Test Coverage
  • Complete Documentation in CocoaDocs and tutorials made with Playgrounds
  • Fully redesigned structure based on stacks
  • REALM support
  • Fully detailed steps to integrate all components in your project (while waiting the integration of CocoaPods)

Note: It's going to suppose a big step to SugarRecord because it's going to make it more flexible for all kind of developers. You can use the current initial version of SugarRecord 0.2 (master branch).

Requirements

  • Xcode 6
  • iOS 7.0+ / Mac OS X 10.9+
  • If you have troubles with the compilation try to clean the DerivedData Xcode directory: rm -rf ~/Library/Developer/Xcode/DerivedData/

Wiki

If you want to know about how to use SugarRecord we have some Wiki pages in the repo to guide you through the integration in your project. Availble Wiki pages are:

  • About SugarRecord: Link
  • Setup SugarRecord: Link
  • Working with Stacks: Link
  • Operations: Link
  • Advanced operations with SugarRecord: Link
  • Mapping models: Link
  • Advices: Link
  • Contribution tips: Link

Support

If you want to communicate any issue, suggestion or even make a contribution, you have to keep in mind the flow bellow:

  • If you need help, ask your doubt in Stack Overflow using the tag 'sugarrecord'
  • If you want to ask something in general, use Stack Overflow too.
  • Open an issue either when you have an error to report or a feature request.
  • If you want to contribute, submit a pull request, and remember the rules to follow related with the code style, testing, ...

Useful Swift Resources

License

The MIT License (MIT)

Copyright (c) <2014> <Pedro Piñera>

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.

Who uses SugarRecord?

If you are currently using SugarRecord in your app, let me know and I'll add it to the list.

sugarrecord's People

Contributors

fjbelchi avatar gitter-badger avatar

Watchers

James Cloos avatar Robert Johnson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.