npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@prisma-idb/client-idb

v0.13.0

Published

Prisma 8 IDB family — ORM client (idbOrm typed query builder)

Readme

@prisma-idb/client-idb

A typed IndexedDB client for Prisma 8. Write a Prisma schema, plan migrations with the prisma-idb CLI, and query IndexedDB from the browser with chained, typed calls. The client applies pending migrations when it opens the database, and enforces foreign keys and onDelete/onUpdate actions like a SQL database.

npm install @prisma-idb/client-idb @prisma/orm-toolchain
import { createAutoMigratingIdbClient } from "@prisma-idb/client-idb/client-auto";
import { contractSpace } from "./prisma/contract-space.generated";

const db = await createAutoMigratingIdbClient({ contractSpace, dbName: "my-app" });

await db.orm.todo.create({ id: crypto.randomUUID(), title: "Write docs", done: false, userId });
const open = await db.orm.todo.where({ done: false }).orderBy({ title: "asc" }).all();

contract-space.generated.ts comes from the build-time tools. The Quick Start sets them up.

Entry points

| Import | Contains | | ------------------------------------ | ----------------------------------------------------------------------------------------------- | | @prisma-idb/client-idb/client-auto | createAutoMigratingIdbClient, createManagedAutoIdbClient: open the database and migrate it. | | @prisma-idb/client-idb/client | createIdbClient, createManagedIdbClient: open an already-migrated database. | | @prisma-idb/client-idb/orm | idbOrm, the accessor types, and the and, or and not filter helpers. |

The internal subpath is for companion packages such as sync-extension-idb. Application code uses the entry points above. For nested writes, pass a relation callback to create() or update(); the client supplies the relation mutator.

Primary-key updates

update(), updateAll(), updateCount() and the update arm of upsert() reject changes to an existing row’s primary key with code PRIMARY_KEY_CHANGE_UNSUPPORTED. The entire mutation rolls back, including referential actions and sync outbox changes. The update input types leave out primary-key fields, so typed code can't set one. This applies to models the contract resolves; for any other model name, only the runtime check applies. At runtime, a patch that repeats the existing key is still allowed, and a query with no matching rows performs no write.

Primary keys are immutable. Delete the row and create it again only after handling dependent records. Restrictive relations can block the delete, and cascading relations can delete dependent records. See ADR 020 for the reasons.

Documentation

License

MIT