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-v7-contest-pocket

v1.2.1

Published

Offline self-contained Prisma ORM v7 Contest 3 handbook, query cookbook, schema patterns, troubleshooting, practice solutions, and seed templates

Downloads

634

Readme

Prisma v7 Contest Pocket

An offline, searchable Prisma ORM v7 Contest 3 handbook for students who are starting from zero. It contains original explanations, a syllabus map, complete query patterns, schema templates, seed templates, error diagnosis, practice questions with worked solutions, and official documentation links.

It is designed to help you look up and adapt the correct approach quickly during practice/contest. It cannot guarantee a solution to every unseen question: always match examples to the schema, database provider, starter code and contest rules. It does not bundle Prisma's full copyrighted documentation verbatim.

Install and run

Once published to npm:

npx prisma-v7-contest-pocket init       # Automatically copies topics/ and examples/ into your project root
npx prisma-v7-contest-pocket start
npx prisma-v7-contest-pocket map
npx prisma-v7-contest-pocket topics
npx prisma-v7-contest-pocket search "some every none"
npx prisma-v7-contest-pocket show query-cookbook
npx prisma-v7-contest-pocket show troubleshoot
npx prisma-v7-contest-pocket practice
npx prisma-v7-contest-pocket seed-templates
npx prisma-v7-contest-pocket seed starter

For repeated lookups in the contest project, install globally before the contest (subject to contest rules):

npm install --global prisma-v7-contest-pocket
prisma-pocket start
prisma-pocket search groupBy having

No runtime dependencies are required. Notes, search, examples and templates work offline after installation. Official web links need internet. The CLI only prints reference text; it does not connect to or alter your database.

Fastest path if you have never studied Prisma

  1. prisma-pocket start — learn the basic mental model and how to choose a query.
  2. prisma-pocket show schema-patterns — copy model/relation patterns.
  3. prisma-pocket show query-cookbook — map question wording to Prisma Client calls.
  4. prisma-pocket show practice — work through solved examples.
  5. prisma-pocket show troubleshoot — diagnose common errors.
  6. prisma-pocket seed-templates — print seed scripts when the question asks for fixtures.
  7. During a question, run prisma-pocket search <keywords>; then show the full matching topic.

Commands

| Command | Purpose | |---|---| | init / copy | Copy topics/ and examples/ directly into your current project root | | start | Beginner roadmap, method decision table and core mental model | | map / syllabus | Map each syllabus item to a note and command | | topics | List all topic files | | search <words...> | Search all notes and example code offline | | show <topic-or-alias> | Print a complete topic note | | cookbook | Print the query cookbook | | practice | Print solved practice tasks | | examples | List example files | | example <filename> | Print a bundled code/schema/config example | | seed-templates | List seed templates | | seed <name> | Print a complete MySQL/MariaDB seed template | | links | Print official documentation URLs | | help | Usage |

Examples of aliases: show setup, show relations, show schema-patterns, show crud, show filtering, show aggregate, show migrate, show seed, show studio, show api, show troubleshoot, show practice.

Included material

  • Beginner path and contest-solving decision tree.
  • ORM, Prisma components, Prisma v7 setup/config/client generation.
  • Scalar fields, defaults, IDs, compound constraints, indexes, mapping.
  • One-to-one, one-to-many, implicit and explicit many-to-many, self-relations.
  • Referential actions and SQL Server/MongoDB caveats.
  • CRUD, select, omit, nested include/select, nested writes and relation filters.
  • Filtering operators, AND/OR/NOT, ordering, offset/cursor pagination.
  • count, aggregate, groupBy, where vs having, and transactions.
  • Migrate mental model, Studio, v7 seeding config and eight seed templates.
  • Common Prisma error codes, schema/config/debugging checklist.
  • Worked practice solutions mapped to typical query prompts.
  • Official docs URLs for checking details and provider-specific limitations.

Seed templates

Print any complete template:

prisma-pocket seed starter
prisma-pocket seed upsert
prisma-pocket seed bulk
prisma-pocket seed relations
prisma-pocket seed many-to-many
prisma-pocket seed explicit-many-to-many
prisma-pocket seed transaction
prisma-pocket seed reset

The templates use Prisma v7 and the self-hosted MySQL/MariaDB driver adapter. They assume particular example models: adapt model/field names, unique selectors, generated-client import path, and environment variables to your project. The reset template is destructive and is guarded by ALLOW_SEED_RESET=YES; use only with disposable data. For PostgreSQL/SQLite/other providers, switch to the corresponding adapter rather than copying the MySQL adapter.

Prisma v7 warning

Prisma v7 setup differs from many old tutorials. Direct database connections require a provider-appropriate driver adapter. The recommended prisma-client generator uses an explicit output path; import from the generated client at that location. prisma.config.ts carries datasource config, and the seed command is configured under migrations.seed; run npx prisma db seed explicitly. Follow the contest starter's actual configured generator/client setup if it differs.

Publishing to npm

Publishing requires your npm account and must be run by you; this package does not have your credentials.

  1. From this directory check name ownership: npm view prisma-v7-contest-pocket name version. If the name exists and is not yours, choose an available name and change package.json.

  2. Sign in with your npm account: npm login.

  3. Validate the package locally:

    npm test
    npm pack --dry-run
    npm pack
  4. Publish the exact tested version:

    npm publish
  5. Verify the public package:

    npx prisma-v7-contest-pocket help
    npx prisma-v7-contest-pocket start

If npm says the version already exists, increment version in package.json, rerun tests/pack, then publish. Never publish secrets, .env files, database dumps or local credentials. The files allowlist controls the package contents.

Version

Version 1.2.0 expands the original quick reference into a beginner-first handbook, adds a full task-to-query cookbook, schema patterns, a syllabus map, troubleshooting guidance, solved practice prompts and a master query-cookbook example. No external runtime dependencies are added.

License

MIT for the original content in this package. Prisma and Prisma ORM are trademarks of their respective owners. Official documentation remains subject to its own copyright and terms.