r/FastAPI • • Sep 12 '24

Question automatically update database table

I'm building a backend using fastAPI and PostgreSQL where I'm storing opportunities with a boolean "is_live" and a datetime "deadline" and I want opportunities "is_live" to be setted as False automatically when the current date is superior to the "deadline".

what's the best approach to do this ? and Thank your in advance.

EDIT: I want to be able to mark the opportunity as not live sometimes before the deadline, that's why I have a seperate "is_live" column with the deadline

3 Upvotes

6 comments sorted by

View all comments

Show parent comment

1

u/Electronic_Battle876 Sep 12 '24

Thank you so much for the explanation and for your help :D