Export the current Prisma version #573
Comments
Thanks for the tip. I'm not sure if this works with tools such as ncc or in specific cloud contexts where node_modules may be handled differently. |
Thanks to @timsuchanek It's here in 2.0.0-alpha.874 Usage: import { PrismaClient, Post, User, version } from '@prisma/client'
const prisma = new PrismaClient()
console.log(version.client) |
This logs
|
Thanks a lot for reporting 🙏 In case it’s not fixed for you - please let us know and we’ll reopen this issue! |
This reports the SHA of the binary version, not the Prisma version. I would have expected to get the Prisma version such as |
Thanks @steebchen. /**
* Query Engine version: 4ff8379527ec7797e7bb5b55d374f82f5812a6f9
* Prisma Client JS version: 2.0.0-alpha.913
*/
exports.version = {
engine: "4ff8379527ec7797e7bb5b55d374f82f5812a6f9",
client: "2.0.0-alpha.913"
} You can try it out in the latest alpha. |
I'd like to be able to access the current Prisma version:
which would print
The main use case for this is to verify our deployment platforms are not out of sync and actually test the latest Prisma version. Also, we think it may be useful if the version string is printed somewhere (maybe additionally in a comment in the first few lines), so users can easily verify that the generated code is indeed generated by a given Prisma version.
The text was updated successfully, but these errors were encountered: