{"id":35568438,"url":"https://github.com/prisma-idb/idb-client-generator","last_synced_at":"2026-05-09T10:58:29.494Z","repository":{"id":259083605,"uuid":"876260840","full_name":"prisma-idb/idb-client-generator","owner":"prisma-idb","description":"The simplicity and features of the Prisma ORM, emulated in IndexedDB. Perfect for web apps needing structured local storage!","archived":false,"fork":false,"pushed_at":"2026-02-01T17:59:36.000Z","size":3935,"stargazers_count":8,"open_issues_count":31,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-02T02:07:38.673Z","etag":null,"topics":["idb","indexeddb","prisma","typescript"],"latest_commit_sha":null,"homepage":"https://idb-client-generator-docs.vercel.app/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prisma-idb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["WhyAsh5114"],"buy_me_a_coffee":"WhyAsh5114"}},"created_at":"2024-10-21T17:05:26.000Z","updated_at":"2026-02-01T18:05:03.000Z","dependencies_parsed_at":"2024-10-25T21:30:02.782Z","dependency_job_id":"8c0bf427-0d27-437e-9dba-7a9ca53cdddb","html_url":"https://github.com/prisma-idb/idb-client-generator","commit_stats":null,"previous_names":["prisma-idb/prisma-idb-generator","prisma-idb/client-generator"],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/prisma-idb/idb-client-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-idb%2Fidb-client-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-idb%2Fidb-client-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-idb%2Fidb-client-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-idb%2Fidb-client-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prisma-idb","download_url":"https://codeload.github.com/prisma-idb/idb-client-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prisma-idb%2Fidb-client-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29169390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T16:33:35.550Z","status":"ssl_error","status_checked_at":"2026-02-06T16:33:30.716Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["idb","indexeddb","prisma","typescript"],"created_at":"2026-01-04T16:15:03.537Z","updated_at":"2026-05-09T10:58:28.969Z","avatar_url":"https://github.com/prisma-idb.png","language":"TypeScript","funding_links":["https://github.com/sponsors/WhyAsh5114","https://buymeacoffee.com/WhyAsh5114"],"categories":[],"sub_categories":[],"readme":"# Prisma IDB\n\n[![Prisma IDB — Type-safe IndexedDB with the Prisma API](https://raw.githubusercontent.com/prisma-idb/idb-client-generator/main/apps/docs/public/og.png)](https://prisma-idb.dev/)\n\n\u003e You already write Prisma on the server. Now write it in the browser.\n\nA Prisma generator that creates a type-safe IndexedDB client with the API you already know — plus an optional sync engine that handles conflict resolution, ownership, and offline-first data for you.\n\n**[Documentation](https://prisma-idb.dev/) · [Live Demo](https://kanban.prisma-idb.dev/) · [npm](https://www.npmjs.com/package/@prisma-idb/idb-client-generator)**\n\n---\n\n## The difference\n\nEven with the [`idb`](https://github.com/jakearchibald/idb) library, querying across relations means manual index lookups, joins in application code, and zero type safety:\n\n```typescript\nconst db = await openDB(\"MyDB\", 1);\n\nconst posts = await db.getAllFromIndex(\"posts\", \"byAuthor\", userId);\n\nconst result = [];\nfor (const post of posts) {\n  if (!post.published) continue;\n  const comments = await db.getAllFromIndex(\"comments\", \"byPost\", post.id);\n  result.push({ ...post, comments });\n}\nresult.sort((a, b) =\u003e b.createdAt - a.createdAt);\n// manual joins, no types, no filtering\n```\n\nPrisma IDB:\n\n```typescript\nconst posts = await idb.post.findMany({\n  where: { authorId: userId, published: true },\n  include: {\n    comments: { orderBy: { createdAt: \"desc\" } },\n  },\n  orderBy: { createdAt: \"desc\" },\n});\n```\n\nSame API as Prisma Client. Fully typed. Works offline.\n\n## And when you need sync...\n\nMost IndexedDB libraries stop at CRUD. This one includes a bidirectional sync engine that handles the hard parts:\n\n```prisma\ngenerator prismaIDB {\n  provider   = \"idb-client-generator\"\n  output     = \"./prisma-idb\"\n  outboxSync = true    // ← one flag\n  rootModel  = \"User\"\n}\n```\n\n- **Outbox pattern** — mutations queue locally, push reliably with retry and batching\n- **Ownership DAG** — authorization is structural, every record traces back to its owner\n- **Conflict resolution** — server-authoritative changelog materialization on pull\n\n## Quick Start\n\n### Install\n\n```bash\npnpm add idb\npnpm add @prisma-idb/idb-client-generator --save-dev\n```\n\n### Configure\n\nAdd the generator to your `schema.prisma`:\n\n```prisma\ngenerator prismaIDB {\n  provider = \"idb-client-generator\"\n  output   = \"./prisma-idb\"\n}\n\nmodel Todo {\n  id    String  @id @default(cuid())\n  title String\n  done  Boolean @default(false)\n}\n```\n\n### Generate \u0026 Use\n\n```bash\npnpm exec prisma generate\n```\n\n```typescript\nimport { PrismaIDBClient } from \"./prisma-idb\";\n\nconst idb = await PrismaIDBClient.createClient();\n\n// Create\nawait idb.todo.create({\n  data: { title: \"Ship it\", done: false },\n});\n\n// Read\nconst todos = await idb.todo.findMany({\n  where: { done: false },\n});\n\n// Update\nawait idb.todo.update({\n  where: { id: todoId },\n  data: { done: true },\n});\n\n// Delete\nawait idb.todo.delete({\n  where: { id: todoId },\n});\n```\n\n## Features\n\n- **Prisma-compatible API** — `create`, `findMany`, `findUnique`, `update`, `delete`, `upsert`, and more\n- **Full type safety** — generated from your Prisma schema with complete autocomplete\n- **Relations** — `include` and `select` work as expected\n- **Offline-first** — all data in IndexedDB, zero network dependency\n- **Optional sync** — bidirectional server sync with conflict resolution and authorization\n- **Client-generated IDs** — `cuid` or `uuid`, no server round-trip for creates\n\n## Resources\n\n- [Documentation](https://prisma-idb.dev/)\n- [Live Kanban Demo](https://kanban.prisma-idb.dev/)\n- [npm Package](https://www.npmjs.com/package/@prisma-idb/idb-client-generator)\n- [Example App Source](./apps/pidb-kanban-example)\n\n## Contributing\n\nContributions welcome. See [CONTRIBUTING.md](./.github/CONTRIBUTING.md).\n\n## Security\n\nSee [SECURITY.md](./.github/SECURITY.md) for reporting vulnerabilities.\n\n## License\n\nMIT. See [LICENSE](./LICENSE).\n\n## Disclaimer\n\nPrisma is a trademark of Prisma. Prisma IDB is an independent open-source project, not affiliated with or endorsed by Prisma.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprisma-idb%2Fidb-client-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprisma-idb%2Fidb-client-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprisma-idb%2Fidb-client-generator/lists"}