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
Maintainers
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 starterFor 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 havingNo 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
prisma-pocket start— learn the basic mental model and how to choose a query.prisma-pocket show schema-patterns— copy model/relation patterns.prisma-pocket show query-cookbook— map question wording to Prisma Client calls.prisma-pocket show practice— work through solved examples.prisma-pocket show troubleshoot— diagnose common errors.prisma-pocket seed-templates— print seed scripts when the question asks for fixtures.- During a question, run
prisma-pocket search <keywords>; thenshowthe 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, nestedinclude/select, nested writes and relation filters. - Filtering operators,
AND/OR/NOT, ordering, offset/cursor pagination. count,aggregate,groupBy,wherevshaving, 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 resetThe 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.
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 changepackage.json.Sign in with your npm account:
npm login.Validate the package locally:
npm test npm pack --dry-run npm packPublish the exact tested version:
npm publishVerify 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.
