Hi all - I'm working with Prisma - (TS over Postgr...
# orm-help
d
Hi all - I'm working with Prisma - (TS over Postgres) and if I look at the generated code, I see a createdAt and upatedAt fields - only they don't seem to be exposed. If I wanted access to those values - can I get to them?
n
You can expose them by adding them to a type in your datamodel, e.g.
Copy code
type User {
  id: ID! @unique
  createdAt: DateTime!
  updatedAt: DateTime!
  name: String
}
This will automatically expose them in the Prisma API.
d
awesome - thanks! should I have been able to see that someplace obvious in documentation?
n
Our docs certainly need to be improved, but there's some docs for those fields here: https://www.prisma.io/docs/1.22/datamodel-and-migrations/datamodel-POSTGRES-knum/#system-fields
d
I see - I'd say this is more RTFM on my part 🙂