Auto delete record using timestamp

How to auto delete a record using timestamp and do a function when delete
7 Replies
Angelelz
Angelelz15mo ago
If you want to do it at the database level, look up triggers and stored procedures
Trần Bá Hiền
Trần Bá HiềnOP15mo ago
how to do that
Angelelz
Angelelz15mo ago
Those are extensive topics, not supported by drizzle yet. But there's plenty of resources out there
Trần Bá Hiền
Trần Bá HiềnOP15mo ago
thanks
francis
francis15mo ago
a note: you probably don't actually want to do this at a database level. alternative strategies: using a view to hide records with a expires_at timestamp prior to the current time, for example: or using a cron operation to clean out the tables on a regular schedule, if that is desired
Trần Bá Hiền
Trần Bá HiềnOP15mo ago
But i don't know how to do that
francis
francis15mo ago
well, do research, we can't help you with that part. nothing here is drizzle specific.

Did you find this page helpful?