Streamlit + real-time + postgresql

I want to ask, I need to retrieve data from PostgreSQL to show that my data is real-time data. How can I operate it? For example, if you want to show a line chart, you can show the changes of each IP address over time.