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/family-idb

v0.14.1

Published

Prisma 8 IDB family — control-plane descriptor and family instance (CLI/config integration)

Readme

@prisma-idb/family-idb

The IndexedDB family for Prisma 8, used at build time. It reads your Prisma schema into an IndexedDB contract, plugs IndexedDB into the prisma CLI, and provides the prisma-idb CLI for migrations.

npm install --save-dev @prisma-idb/family-idb

The prisma-idb CLI

IndexedDB only exists in the browser, so three migration jobs need their own commands:

| Command | Does | | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | prisma-idb migration plan | Plans the next migration from the newest one on disk. Warns if it deletes data. | | prisma-idb migration contract-space | Bundles the migrations into a module the browser imports. | | prisma-idb migration preflight | Replays migrations in memory, verifies the schema against the head snapshot, and checks that the emitted contract is the head. |

All three read prisma.config.ts. See Migrations.

Entry points

| Import | Contains | | ------------------------------------- | -------------------------------------------------------------------- | | @prisma-idb/family-idb/control | The family descriptor for prisma.config.ts. | | @prisma-idb/family-idb/config-types | defineConfig for prisma.config.ts. | | @prisma-idb/family-idb/contract-psl | prismaIdbContract(path, { projection }): reads a .prisma schema. | | @prisma-idb/family-idb/contract-ts | defineContract(): write a contract in TypeScript instead. | | @prisma-idb/family-idb/cli | The prisma-idb commands, for embedding in another CLI. |

Contract authoring

Author a contract in PSL with prismaIdbContract(path, options?), or in TypeScript with defineContract(input, options?). Both surfaces lower into one internal IdbContractDefinition and use the same validation and hash builder. Equivalent definitions produce the same storage, profile, and execution hashes.

For Prisma VS Code extension hints, put // use prisma-8 on the first line of the .prisma file, before other comments. This selects the Prisma 8 language server, which uses the project's local prisma CLI and prisma.config.ts to discover IDB scalar types, attribute signatures, hover descriptions, and diagnostics. Without the directive, the extension uses the legacy server. Run Prisma: Restart Language Server after changing the directive or rebuilding workspace packages. See Editor Setup.

TypeScript models use a defaults map for create-time literals and helpers: autoincrement(), now(), uuidv4(), uuidv7(), cuid2(), and updatedAt(). Import the helpers from @prisma-idb/family-idb/contract-ts. The older fieldDefaults map only supplies values for the setDefault referential action.

Both surfaces index each foreign-key field by default. TypeScript relations can set index: false to opt out. Existing TypeScript contracts may get a new storageHash and need an index migration. See Adopt Foreign-Key Indexes.

Invalid shared definitions throw IdbContractError from the TypeScript entry point. Its diagnostics array lists IDB_* codes, messages, and definition paths. PSL reports the corresponding diagnostics with source spans. See Contract Authoring for attribute mappings, defaults, indexes, and diagnostic codes.

Documentation

License

MIT