Title
m

Martïn

02/03/2021, 2:47 AM
Hey there. Is it currently possible to set some sort of "expiry" time on data entries in PostgreSQL using Prisma? I'm thinking about something equivalent to EXPIRE in Redis. I'm not looking to store a timestamp and then manually code some sort of cron job to check what entries have expired. Though using TRIGGERS will do the trick. I really think Prisma should provide this sort of functionality, and should be in the roadmap as a feature for future releases. E.g.
model Coupon {
id String @id @default(cuid())
code String @unique @expire(after: ‘60s’)
profileId String @unique
...
}
So
code
expires and row is deleted from the DB after 60s
r

Ryan

02/03/2021, 6:34 AM
@Martïn 👋 I would suggest creating a feature request for this here so that we can look into this 🙂
m

Martïn

02/03/2021, 9:31 AM