SupabaseS
Supabase2mo ago
Idris

Deleting files from db

Hi, I want to delete files from the DB, so I will need to use pg net.
I want to delete files attached to tasks, when the task gets deleted. I was thinking 2 approaches. Sending the DELETE request on a trigger when the task gets deleted.
Or doing nothing and have a nightly cron job delete them.

I suppose the second one is better since the first one has no gaurentee since the request with pg net are fire and forget so cant rollback. But would love to hear your thoughts.
Was this page helpful?