John Cantrell
07/23/2020, 3:17 PMRyan
07/24/2020, 7:59 AMprisma.queryRaw to get the enum values.
Something like this should work for Postgres:
await prisma.queryRaw`select unnest(enum_range(null::enum_name))`janpio
tim2
07/27/2020, 9:28 AMschema.prisma
enum Tree {
ARBORVITAE
YELLOWBIRCH
BLACKASH
DOUGLASFIR
OAK
}
file.ts
import { Tree } from '@prisma/client'
console.log(Tree)
logs:
{
ARBORVITAE: 'ARBORVITAE',
YELLOWBIRCH: 'YELLOWBIRCH',
BLACKASH: 'BLACKASH',
DOUGLASFIR: 'DOUGLASFIR',
OAK: 'OAK'
}