{"id":22413598,"url":"https://github.com/nextfaze/couchdbsyncer-ios","last_synced_at":"2025-07-14T15:33:18.745Z","repository":{"id":138429728,"uuid":"2033523","full_name":"NextFaze/couchdbsyncer-ios","owner":"NextFaze","description":"iOS library to perform a one-way sync of documents and attachments from a couchdb database to a local core data store","archived":false,"fork":false,"pushed_at":"2011-10-05T00:13:33.000Z","size":273,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-07-01T04:01:52.643Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/NextfazeSD/couchdbsyncer-ios","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NextFaze.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-07-12T00:53:55.000Z","updated_at":"2015-05-19T05:19:11.000Z","dependencies_parsed_at":"2023-03-13T10:54:01.997Z","dependency_job_id":null,"html_url":"https://github.com/NextFaze/couchdbsyncer-ios","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/NextFaze/couchdbsyncer-ios","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextFaze%2Fcouchdbsyncer-ios","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextFaze%2Fcouchdbsyncer-ios/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextFaze%2Fcouchdbsyncer-ios/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextFaze%2Fcouchdbsyncer-ios/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NextFaze","download_url":"https://codeload.github.com/NextFaze/couchdbsyncer-ios/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NextFaze%2Fcouchdbsyncer-ios/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265312033,"owners_count":23745177,"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-12-05T14:13:36.941Z","updated_at":"2025-07-14T15:33:18.722Z","avatar_url":"https://github.com/NextFaze.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"CouchDBSyncer\n=============\n\nCouchDBSyncer - syncs couchdb databases from the server, saving data locally in a core data database.\n\nExternal requirements:\n\n* json-framework\n\nInstallation\n------------\n\n    \u003e git clone git://github.com/2moro/CouchDBSyncer-iOS.git\n    \u003e cd CouchDBSyncer-iOS\n    \u003e git submodule init\n    \u003e git submodule update\n\nCouchDBSyncer is a Cocoa Touch Static Library project, and can be incorporated into other xcode projects in the usual ways.\n\nYou will need CoreData framework to be linked.\n\nYou will need to add a copy of the CouchDBSyncer database model to your project (called CouchDBSyncer.xcdatamodeld).\n\nUsage\n-----\n\nCouchDBSyncerStore handles storage of data locally in a core data store.\n\nApplications will typically create a single shared instance of CouchDBSyncerStore.\n\na CouchDBSyncer object is used to download changes from a remote CouchDB database to the local store. \nThe Syncer uses the bulk document fetch API (http://wiki.apache.org/couchdb/HTTP_Bulk_Document_API) to fetch all changed documents in a single HTTP request.\n\nIf you want to limit the number of documents fetched by each HTTP request, you can set the docsPerReq property on your Syncer object (see section on Tunables below).\nAttachments are fetched in separate HTTP requests.\n\n    // create a local store object\n    CouchDBSyncerStore *store = [[CouchDBSyncerStore alloc] init];\n\n    // or, to use a shipped database as a starting point:\n    CouchDBSyncerStore *store = [[CouchDBSyncerStore alloc] initWithShippedDatabase:@\"shipped_db.sqlite\"];\n\n    // get the database DB_NAME.  updates the database url to the given DB_URL.\n    // creates a new local database record if it has not been created yet.\n    CouchDBSyncerDatabase *database = [store database:DB_NAME url:[NSURL urlWithString:DB_URL]];\n\n    // create a syncer to fetch changes\n    CouchDBSyncer *syncer = [[CouchDBSyncer alloc] initWithStore:store database:database];\n    [syncer update];   // asynchronous call - creates an update thread\n\nSync Progress\n-------------\n\nCouchDBSyncer broadcasts progress notifications which you can listen to if required.\nThe notifications are:\n\n* CouchDBSyncerProgressNotification - some progress has been made\n* CouchDBSyncerCompleteNotification - sync has completed\n* CouchDBSyncerErrorNotification - sync encountered an error\n\nDatabase/Document/Attachment API\n--------------------------------\n\nthe following attributes are saved separately as part of a document record, if available:\n\n* type      (to change this, set the store.modelTypeKey tunable property)\n* parent_id (accessible as \"parentId\" in the document record)\n\nDownload policies\n-----------------\n\nA variant of the update method of CouchDBSyncer accepts an object implementing the CouchDBSyncerDownloadPolicy protocol.\nThis can be used to download documents/attachments selectively, or with different priorities.\n\ne.g.\n    // assumes self implements the CouchDBSyncerDownloadPolicyDelegate protocol\n    syncer.downloadPolicyDelegate = self;\n    [syncer update];\n\nThe default is to download all documents and attachments.  By default, documents are downloaded with priority NSOperationQueuePriorityNormal, and attachments\nare downloaded with priority NSOperationQueuePriorityLow.\n\nMetadata for attachments that are not downloaded is stored in the database, and is accessible via the attachments method of CouchDBSyncerDocument.\n(This allows attachments to be accessed later if required).  If an attachment has newer content on the server, its stale attribute will be true.\n\nAccessing databases / documents / attachments\n---------------------------------------------\n\nsee CouchDBSyncerStore.h for the full list of public API methods.\n\ndocuments can be accessed using the following methods of CouchDBSyncerStore.\n\n    - (NSArray *)documents:(CouchDBSyncerDatabase *)database;\n    - (NSArray *)documents:(CouchDBSyncerDatabase *)database matching:(NSPredicate *)predicate;\n    - (NSArray *)documents:(CouchDBSyncerDatabase *)database ofType:(NSString *)type;\n\nThe above methods return arrays of CouchDBSyncerDocument objects.  The dictionary method of CouchDBSyncerDocument can be used to access the \ndocument contents as an NSDictionary (converted from JSON).  Each document has an array of attachment metadata attached to it.\n\nAttachment content is not read from the database by the above methods. To fetch attachment content, use the following methods of CouchDBSyncerStore.\n\n    - (NSArray *)attachments:(CouchDBSyncerDocument *)document;\n    - (CouchDBSyncerAttachment *)attachment:(CouchDBSyncerDocument *)document named:(NSString *)name;\n\nTunables\n--------\n\nTunable properties:\n\n    syncer.docsPerReq = 100;          // 0 (unlimited) by default, limit the number of documents per fetch request\n    syncer.maxConcurrentFetches = 3;  // 3 by default, limit the number of maximum concurrent fetch requests\n    \n    store.modelTypeKey = @\"type\";     // \"type\" by default, the document field to store in the document.type attribute.\n\nLicense\n-------\nCopyright 2011 2moro mobile\nsee also LICENSE.txt\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextfaze%2Fcouchdbsyncer-ios","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextfaze%2Fcouchdbsyncer-ios","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextfaze%2Fcouchdbsyncer-ios/lists"}