{"id":18352926,"url":"https://github.com/aaronhuggins/pouchdb_deno","last_synced_at":"2025-04-06T11:33:11.587Z","repository":{"id":39253723,"uuid":"456378902","full_name":"aaronhuggins/pouchdb_deno","owner":"aaronhuggins","description":"PouchDB for Deno, leveraging polyfill for IndexedDB based on SQLite.","archived":false,"fork":false,"pushed_at":"2022-06-28T21:42:50.000Z","size":109,"stargazers_count":25,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-26T18:17:00.004Z","etag":null,"topics":["deno","pouchdb","server-side"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/aaronhuggins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-07T06:06:10.000Z","updated_at":"2024-08-13T16:21:30.000Z","dependencies_parsed_at":"2022-08-29T06:50:19.906Z","dependency_job_id":null,"html_url":"https://github.com/aaronhuggins/pouchdb_deno","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronhuggins%2Fpouchdb_deno","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronhuggins%2Fpouchdb_deno/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronhuggins%2Fpouchdb_deno/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronhuggins%2Fpouchdb_deno/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaronhuggins","download_url":"https://codeload.github.com/aaronhuggins/pouchdb_deno/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478152,"owners_count":20945258,"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":["deno","pouchdb","server-side"],"created_at":"2024-11-05T21:37:56.868Z","updated_at":"2025-04-06T11:33:10.874Z","avatar_url":"https://github.com/aaronhuggins.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PouchDB for Deno\n\n[PouchDB](https://github.com/pouchdb/pouchdb) for Deno, leveraging polyfill for\n[IndexedDB based on SQLite](https://github.com/aaronhuggins/indexeddb).\n\n## Usage\n\n```typescript\nimport PouchDB from \"https://deno.land/x/pouchdb_deno@2.1.0-PouchDB+7.3.0/modules/pouchdb/mod.ts\";\n\n// Use the 'idb' adapter for IndexedDB and persistence to disk.\nconst db = new PouchDB(\"mydb\", { adapter: \"idb\" });\nconst doc = { hello: \"world\" };\nconst result = await db.post(doc);\n\nconsole.log(result);\n\nconst getDoc = await db.get(result.id);\n\nconsole.log(getDoc);\n\nconst docs = await db.allDocs();\n\nconsole.log(docs);\n```\n\n## Features\n\nAll working plugins are included in the main export of PouchDB for Deno.\n\n**Out-of-the-box:**\n\n- PouchDB-core imports into Deno without issue\n- HTTP/S instances appear to work using PouchDB-Server using the http plugin\n- PouchDB-Find plugin\n- PouchDB-MapReduce plugin\n- Replication\n\n**With work-arounds:**\n\n- PouchDB-Adapter-IDB\n- PouchDB-Adapter-IndexedDB\n- PouchDB-Adapter-Memory\n\n**Original:**\n\n- PouchDB-Upsert plugin\n\n## Documentation\n\nNearly all documentation at [PouchDB.com](https://pouchdb.com/) applies to this\nlibrary. Known differences are called out below.\n\n\u003e **WARNING**: The new `indexeddb` adapter is in a beta state. Use with caution.\n\u003e Additionally, this new adapter has an underling IndexedDB schema which is\n\u003e incompatible with the older `idb` adapter. If switching adapters and data is\n\u003e needed, it will need to be migrated manually at this time. It is unknown if\n\u003e automatic migration from `idb` to `indexeddb` adapter will be supported in a\n\u003e future release.\n\n### Adapters\n\nCurrently, the only adapters known to work in Deno are bootstrapped in this\nrepository. However, new adapters written from scratch targeting Deno _should_\nwork out-of-the-box when calling `PouchDB.plugin`. If new adapters written for\nDeno do not work, file issues and make sure to cross-link them in this repo and\nat [PouchDB's repo](https://github.com/pouchdb/pouchdb/issues).\n\n### IndexedDB\n\nAll options work as documented by PouchDB, with two subtle differences and a new\noption just for Deno. This applies to both `adapter: \"idb\"` and\n`adapter: \"indexeddb\"`.\n\n- Database names are not prefixed with `_pouch_` in Deno like they are on web\n- `prefix`: Takes a string argument, and can be used exactly like the LevelDB\n  adapter to provide a directory for the database(s); **trailing slash is\n  required**\n- `systemPath` (Deno-specific flag): The IndexedDB implementation (see below)\n  uses a \"system\" database `__sysdb__` for metadata about databases; supply a\n  path to store this database in a custom directory\n\nSince Deno does not ship with an official IndexedDB interface, it must be\npolyfilled for the related PouchDB adapter to work.\n[IndexedDBShim](https://github.com/indexeddbshim/IndexedDBShim) makes this\npossible, on top of a WebSQL ponyfill written specifically for this codebase.\n\nShould Deno ever\n[implement this feature natively](https://github.com/denoland/deno/issues/1699),\nthe polyfill will be dropped to improve performance.\n\n### LevelDOWN\n\nThe only PouchDB adapter based on LevelDOWN known to work is the memory adapter.\nLocal storage leveldown was tested and found to be incompatible. Other adapters\nthrew errors from Skypack.dev CDN import; the message reported was related to an\nout-of-date version of the `readable-stream` NPM module.\n\n### Types\n\nAugmentation was extremely difficult to perform by directly referencing PouchDB\ntypes from the DefinitelyTyped project. Instead, the relevant types were copied\nfrom DefinitelyTyped and merged by hand.\n\n## Why?\n\n[I did this because I love PouchDB, thought I could get PouchDB working, and I was impatient.](https://github.com/pouchdb/pouchdb/issues/8158)\n\n![Thanos picks up Infinity Gauntlet; says \"Fine, I'll do it myself.\"](https://thumbs.gfycat.com/BogusForsakenAsianlion-size_restricted.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronhuggins%2Fpouchdb_deno","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronhuggins%2Fpouchdb_deno","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronhuggins%2Fpouchdb_deno/lists"}