How To Add Filters For Querying Databases In Streamlit

Billy Bonaros
3 min readJul 4, 2022
Photo by Tobias Fischer on Unsplash

In this tutorial, we will show you how you can use filters for databases in Streamlit. We will use PostgresSQL but you can use the same logic everywhere.

The hypothetical database that we are going to use has a table called movies and we want to filter it based on the genre and the language.

SELECT title FROM movies
genre = 'Action'