{"id":20226045,"url":"https://github.com/augustrush/arcoredata","last_synced_at":"2025-07-06T15:08:42.651Z","repository":{"id":18281150,"uuid":"21447895","full_name":"AugustRush/ARCoreData","owner":"AugustRush","description":"The easist way to use core data!","archived":false,"fork":false,"pushed_at":"2024-01-31T06:29:14.000Z","size":574,"stargazers_count":181,"open_issues_count":1,"forks_count":45,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-10T02:54:15.967Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AugustRush.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-07-03T02:54:01.000Z","updated_at":"2024-09-14T19:11:42.000Z","dependencies_parsed_at":"2025-01-02T13:10:34.656Z","dependency_job_id":"49bfb6d6-828a-484d-8619-ae97025fe61a","html_url":"https://github.com/AugustRush/ARCoreData","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/AugustRush/ARCoreData","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustRush%2FARCoreData","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustRush%2FARCoreData/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustRush%2FARCoreData/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustRush%2FARCoreData/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AugustRush","download_url":"https://codeload.github.com/AugustRush/ARCoreData/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AugustRush%2FARCoreData/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263922512,"owners_count":23530338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T07:15:55.352Z","updated_at":"2025-07-06T15:08:42.633Z","avatar_url":"https://github.com/AugustRush.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://github.com/AugustRush/ARCoreData/blob/master/6DB73380-0D9A-43A1-AD21-8374D748429A.png)\n\n## This library is deprecated！！！Do not use.\n* ARCoreData is a library to make CoreData easily. we can become a good friend with CoreData now. Don't need any config，just enjoy a high performance object storage。\n\n*****************************************\n\n## Features\n\n###### Primary Key\n\n###### Auto Mapping (attribute，relationship)\n\n###### Multi Thread Safety\n\n###### Async fetch\n\n###### ARTableViewFetchResultController (a convenience class to replace NSFetchResultControler for UITableView)\n\n###### ARCollectionViewFetchResultController (a convenience class to replace NSFetchResultControler for UICollectionView)\n\n## Install\n\n####  Manually\njust drag ARCoreData to your project and edit you model , do not need to config any others \n\u003cbr\u003eImport: `#import \"ARCoreData.h\"`\n\n#### Cocoapods\n* pod 'ARCoreData', :git =\u003e 'https://github.com/AugustRush/ARCoreData.git'\n\n## Getting start\n***********************\n\n## Creat a new object\n\n```\n+ (id)AR_new;\n\n+ (id)AR_newInContext:(NSManagedObjectContext *)context;\n\n+ (id)AR_newOrUpdateWithJSON:(id)JSON inContext:(NSManagedObjectContext *)context;\n\n+ (NSArray *)AR_newOrUpdateWithJSONs:(NSArray *)JSONs inContext:(NSManagedObjectContext *)context;\n\n+ (id)AR_newOrUpdateWithJSON:(id)JSON relationshipMergePolicy:(ARRelationshipMergePolicy)policy inContext:(NSManagedObjectContext *)context;\n\n+ (NSArray *)AR_newOrUpdateWithJSONs:(NSArray *)JSONs relationshipsMergePolicy:(ARRelationshipMergePolicy)policy inContext:(NSManagedObjectContext *)context;\n\n```\n## Mapping\n\n```\n@protocol ARManageObjectMappingProtocol \u003cNSObject\u003e\n\n+(NSDictionary *)JSONKeyPathsByPropertyKey;\n\n@optional\n+(NSSet *)uniquedPropertyKeys;\n\n```\n\nyou have seen [ARManageObjectMappingProtocol](https://github.com/AugustRush/ARCoreData/blob/master/ARCoreData/Core/ARManageObjectMappingProtocol.h), yes, this protocol has two methods, like famous mapping library \u003ca href=\"https://github.com/Mantle/Mantle\"\u003eMantle\u003c/a\u003e, but it must be faster than Mantle. You just need to implement and use these two methods, it will automatically transfrom a JSON(s) or KVC object(s) to NSManageObject(s) instance. Overall, it's very easy and safe.\n\nI have implemented some methods, you can use server response directly to create an(or a array) manageObject(s),\nthere are some methods you can use to sync JSONs to persistance store (.sqlite):\n\n```\n+ (id)AR_newOrUpdateWithJSON:(id)JSON inContext:(NSManagedObjectContext *)context;\n\n+ (NSArray *)AR_newOrUpdateWithJSONs:(NSArray *)JSONs relationshipsMergePolicy:(ARRelationshipMergePolicy)policy inContext:(NSManagedObjectContext *)context;\n\n```\n\n#### Note: you can create a custom mapping for you CoreData model's attribute or relationships like Mantle. Check more details in the demo.\n\n## Fetching objects\n\n```\n+(id)AR_anyone;\n\n+(NSArray *)AR_all;\n\n+(NSArray *)AR_whereProperty:(NSString *)property\n                     equalTo:(id)value;\n\n+(NSArray *)AR_where:(NSString *)condition,...;\n\n+(NSUInteger)AR_count;\n\n.......\n\n```\n\nExample:\n```\n    NSArray *allPersons = [Person AR_all];\n    \n    NSArray *persons = [Person AR_where:@\"name = %@\",@\"a name\"];\n    \n    NSArray *persons = [Person AR_whereProperty:@\"guid\" equalTo:@3];\n```\nand so on !!!\n\n## Saving objects\n\n```\n* sync\n   //NSManageObjectID is thread safety\n    [Person AR_saveAndWait:^(NSManagedObjectContext *currentContext) {\n        Dog *deleteDog = (Dog *)[currentContext existingObjectWithID:objectID error:nil];\n        [currentContext deleteObject:deleteDog];\n    }];\n\n* async\n\n[Person AR_save:^(NSManagedObjectContext *currentContext) {\n                [Person AR_newOrUpdateWithJSON:@{@\"n\":name,\n                                                 @\"g\":@\"3\",\n                                                 @\"s\":@YES,\n                                                 @\"ds\":@[@{@\"n\":@\"123\",\n                                                           @\"g\":@{@\"uid\":@\"123\",\n                                                                  @\"extra\":@34}},\n                                                         @{@\"n\":name,\n                                                           @\"g\":@{@\"uid\":@\"123\",\n                                                                  @\"extra\":@34}}]} inContext:currentContext];\n        } completion:^(NSError *error) {\n            ARLog(@\"all person count is %lu\",(unsigned long)[Person AR_count]);\n            ARLog(@\"all dogs count is %lu\",(unsigned long)[Dog AR_count]);\n        }];\n\n\n\n```\n## TODO:\n\n* Migration\n\n* Encryption\n\n## TL;DR:\nthere have more methods I have created, you can see it in the Demo project after. This library also works in\nSwift!\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugustrush%2Farcoredata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faugustrush%2Farcoredata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugustrush%2Farcoredata/lists"}