{"id":4699,"url":"https://github.com/carbureted/react-native-pouchdb","last_synced_at":"2025-05-13T20:33:05.532Z","repository":{"id":57339268,"uuid":"50152809","full_name":"carbureted/react-native-pouchdb","owner":"carbureted","description":"Hacky way to run pouchdb in react-native","archived":false,"fork":false,"pushed_at":"2016-04-13T06:05:23.000Z","size":123,"stargazers_count":40,"open_issues_count":2,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-29T14:08:28.855Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carbureted.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-22T02:45:04.000Z","updated_at":"2024-05-14T01:33:32.000Z","dependencies_parsed_at":"2022-09-02T00:13:13.353Z","dependency_job_id":null,"html_url":"https://github.com/carbureted/react-native-pouchdb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbureted%2Freact-native-pouchdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbureted%2Freact-native-pouchdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbureted%2Freact-native-pouchdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carbureted%2Freact-native-pouchdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carbureted","download_url":"https://codeload.github.com/carbureted/react-native-pouchdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253411528,"owners_count":21904147,"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-01-05T20:17:20.643Z","updated_at":"2025-05-13T20:33:05.200Z","avatar_url":"https://github.com/carbureted.png","language":"JavaScript","funding_links":[],"categories":["Components","JavaScript"],"sub_categories":["Storage"],"readme":"# react-native-pouchdb\nHacky and mostly untested way to run pouchdb in react-native! I haven't encountered any glaring problems during development, but would not use this in a space shuttle app.\n\nFirst, install [react-native-sqlite-storage](https://github.com/andpor/react-native-sqlite-storage).\n\nThen, install react-native-pouchdb.\n\n`npm install --save react-native-pouchdb`\n\nThen, use it with the websql adapter.\n\n```\nvar db = new PouchDB('test', {\n  adapter: 'websql'\n});\n```\n\nNow you have all the normal pouchdb goodness!\n\n```\nvar db = new PouchDB('test', {\n  adapter: 'websql'\n});\n\nvar remote = 'https://my.remote.couch'\nvar remoteDB = new PouchDB(remote)\n\nvar sync = db.sync(remoteDB, {\n  live: true,\n  retry: true\n}).on('change', function(change) {\n  console.log(change, 'change!')\n}).on('error', function(error) {\n  console.log(error, 'error!')\n})\n\ndb.info().then(console.log.bind(console));\n\nfunction showTodos() {\n  db.allDocs({include_docs: true, descending: true}, function(err, doc) {\n    console.log(doc.rows, doc.rows.length, 'show docs')\n  });\n}\n\nfunction addTodo(text) {\n  var todo = {\n    _id: new Date().toISOString(),\n    title: text,\n    completed: false\n  };\n  db.put(todo, function callback(err, result) {\n    if (!err) {\n      console.log('Successfully posted a todo!', result);\n      showTodos()\n    }\n    else {\n      console.log(err, 'err')\n    }\n  });\n}\n\naddTodo(\"testing todo\")\n\ndb.changes({\n  since: 'now'\n}).on('change', function (change) {\n  console.log('thats a change')\n}).on('error', function (err) {\n  console.log('change error?')\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarbureted%2Freact-native-pouchdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarbureted%2Freact-native-pouchdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarbureted%2Freact-native-pouchdb/lists"}