* This function ensures that each generated client has unique package name * It appends sha256 of the schema to the fixed prefix. That ensures unique schemas * produce unique generated packages while still keeping `generate` results reproducible. * * Without unique package name, if you have seve
(datamodel: string)
| 652 | * @returns |
| 653 | */ |
| 654 | function getUniquePackageName(datamodel: string) { |
| 655 | const hash = createHash('sha256') |
| 656 | hash.write(datamodel) |
| 657 | return `${GENERATED_PACKAGE_NAME_PREFIX}${hash.digest().toString('hex')}` |
| 658 | } |
| 659 | |
| 660 | const GENERATED_PACKAGE_NAME_PREFIX = 'prisma-client-' |
no test coverage detected