{"id":13428705,"url":"https://github.com/martydill/ios-queryable","last_synced_at":"2025-03-16T01:32:53.916Z","repository":{"id":56915119,"uuid":"6644287","full_name":"martydill/ios-queryable","owner":"martydill","description":"ios-queryable is an implementation of IQueryable/IEnumerable for Core Data","archived":false,"fork":false,"pushed_at":"2015-09-01T20:42:30.000Z","size":622,"stargazers_count":227,"open_issues_count":1,"forks_count":18,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-02-23T03:32:24.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/martydill.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}},"created_at":"2012-11-11T20:55:42.000Z","updated_at":"2023-10-30T13:13:15.000Z","dependencies_parsed_at":"2022-08-21T02:51:00.703Z","dependency_job_id":null,"html_url":"https://github.com/martydill/ios-queryable","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martydill%2Fios-queryable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martydill%2Fios-queryable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martydill%2Fios-queryable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martydill%2Fios-queryable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martydill","download_url":"https://codeload.github.com/martydill/ios-queryable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814905,"owners_count":20352037,"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-07-31T01:01:03.202Z","updated_at":"2025-03-16T01:32:53.619Z","avatar_url":"https://github.com/martydill.png","language":"Objective-C","readme":"#ios-queryable is an Objective-C category that provides IQueryable and IEnumerable-like functionality to Core Data.\n\nTired of writing boilerplate Core Data code? Can't live without LINQ? ios-queryable is for you!\n\nIt supports query composition and deferred execution, and implements a subset of IEnumerable's methods, including where, take, skip, orderBy, first/firstOrDefault, single/singleOrDefault, count, any, and all.\n\n\nIt lets you write code like this:\n```objc\nNSArray* widgets = [[[[[self.managedObjectContext ofType:@\"Widget\"]\n\t\t\twhere:@\"Type == 'abc'\"]\n\t\t\torderBy:@\"createddate\"]\n\t\t\ttake:5]\n\t\t\ttoArray];\n```\n\ninstead of like this:\n```objc\nNSFetchRequest* fetchRequest = [[NSFetchRequest alloc] init];\nNSEntityDescription* entity = [NSEntityDescription\n                               entityForName:@\"Widget\" inManagedObjectContext:self.managedObjectContext];\n[fetchRequest setEntity:entity];\n \nNSPredicate* predicate = [NSPredicate predicateWithFormat: @\"type == 'abc'\"];\n[fetchRequest setPredicate:predicate];\n \nNSSortDescriptor* sortDescriptor = [[NSSortDescriptor alloc]\n                                    initWithKey:@\"createddate\" ascending:YES];\n \nNSArray* sortDescriptors = [[NSArray alloc] initWithObjects: sortDescriptor, nil];\n[fetchRequest setSortDescriptors:sortDescriptors];\n \n[fetchRequest setFetchLimit:5];   \nNSError* error;\nNSArray* widgets = [self.managedObjectContext executeFetchRequest:fetchRequest error:\u0026error];\n```\n\nIt also supports the NSFastEnumeration protocol, allowing for easy use in foreach loops:\n```objc\nforeach(Widget* widget in [self.managedObjectContext ofType:@\"Widget\"])\n{\n\t// Do widgety stuff\n}\n```\n#Usage\nTo use ios-queryable, simply copy NSManagedObjectContext+IQueryable.h and NSManagedObjectContext+IQueryable.m into your project folder. Then, simply include the header file, and start writing your queries!\n\nFor examples, check out the tests in the tests project.\n","funding_links":[],"categories":["Core Data","Objective-C","etc"],"sub_categories":["Other free courses"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartydill%2Fios-queryable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartydill%2Fios-queryable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartydill%2Fios-queryable/lists"}