{"id":15354994,"url":"https://github.com/capaj/prisma-generator-checker","last_synced_at":"2026-01-07T13:06:49.877Z","repository":{"id":175034118,"uuid":"653192006","full_name":"capaj/prisma-generator-checker","owner":"capaj","description":"tiny prisma generator to check whether you have the latest generated prisma schema","archived":false,"fork":false,"pushed_at":"2023-06-14T10:27:42.000Z","size":115,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-09T21:10:33.724Z","etag":null,"topics":["prisma","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/capaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-13T15:16:04.000Z","updated_at":"2023-07-16T04:30:54.000Z","dependencies_parsed_at":"2023-06-26T05:15:42.504Z","dependency_job_id":null,"html_url":"https://github.com/capaj/prisma-generator-checker","commit_stats":null,"previous_names":["capaj/prisma-generator-checker"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fprisma-generator-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fprisma-generator-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fprisma-generator-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/capaj%2Fprisma-generator-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/capaj","download_url":"https://codeload.github.com/capaj/prisma-generator-checker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245908773,"owners_count":20692162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["prisma","typescript"],"created_at":"2024-10-01T12:22:00.875Z","updated_at":"2026-01-07T13:06:49.778Z","avatar_url":"https://github.com/capaj.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# prisma-generator-checker\n\nVery tiny/simple generator to check whether you have the latest generated prisma schema or not.\n\nTODO automatically generate prisma schema when it is out of sync\n\n## How to use\n\nmake sure you have `.env` file in your project root folder.\n\nAdd this:\n\n```prisma\ngenerator prisma_checker {\n  provider = \"npx prisma-generator-checker\"\n}\n```\n\nto your `schema.prisma`\n\nthen at runtime, you can do\n\n```ts\nimport { checkPrismaSchemaHash } from '../node_modules/prisma-generator-checker/dist/checkPrismaSchemaHash'\n\nif (process.env.NODE_ENV !== 'production') {\n  // prisma generator checker should not be needed for prod as long as you trust your CI to generate the prisma client correctly\n  checkPrismaSchemaHash()\n}\n```\n\nthis will check sha hash of the schema.prisma file to make sure it matches to the one stored in `.env` when your prisma generation was last executed. If it does not match, it throws an error like this:\n\n```\nError: Prisma schema hash does not match the one in .env, please run prisma generate and commit the changes.\n    at Object.\u003canonymous\u003e (/home/capaj/oss/prisma-generator-checker/packages/generator/src/runtimeChecker.ts:7:11)\n    at Module._compile (node:internal/modules/cjs/loader:1155:14)\n    at Module.m._compile (/home/capaj/.local/share/pnpm/global/5/.pnpm/ts-node@10.9.1_typescript@4.8.2/node_modules/ts-node/src/index.ts:1618:23)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1209:10)\n    at Object.require.extensions.\u003ccomputed\u003e [as .ts] (/home/capaj/.local/share/pnpm/global/5/.pnpm/ts-node@10.9.1_typescript@4.8.2/node_modules/ts-node/src/index.ts:1621:12)\n    at Module.load (node:internal/modules/cjs/loader:1033:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:868:12)\n    at Module.require (node:internal/modules/cjs/loader:1057:19)\n    at require (node:internal/modules/cjs/helpers:103:18)\n    at Object.\u003canonymous\u003e (/home/capaj/oss/prisma-generator-checker/packages/usage/\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fprisma-generator-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapaj%2Fprisma-generator-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapaj%2Fprisma-generator-checker/lists"}