Skip to content
Home » Image Gallery with PostgreSQL- Problem 06

Image Gallery with PostgreSQL- Problem 06

We will enhance the solution to get data from PostgreSQL a popular database engine. Change the APIs to fetch data from PostgreSQL database. In this exercise you will learn how to setup and use PostgreSQL

PostgreSQL

PostgreSQL is a powerful open-source relational database management system (RDBMS) that is known for its reliability, stability, and robustness. It was first released in 1995 as a successor to the Ingres database system, and has since become one of the most popular databases in use today.

PostgreSQL is designed to be scalable and extensible, and supports a wide range of advanced features, including complex queries, transactions, stored procedures, and triggers. It also includes support for a wide range of programming languages, including C, Java, Python, and Perl, among others.

One of the key benefits of PostgreSQL is its ability to handle large volumes of data and complex workloads, while providing high levels of data integrity and consistency. It is widely used in industries such as finance, healthcare, and government, where data security and reliability are critical. Additionally, PostgreSQL is free and open source, which makes it a popular choice for organizations that are looking for a cost-effective and flexible database solution.


Exercise

Add an extra route /db/load

Create a migration to for adding a table with name media

The table should have following columns , id, url (unique) , width, height

Make use of request library to get the actual url of the image and that to db

Change the API to get data from database and send that as API response

Add two textbox to UI to alllow filtering based on width / height

Change the api /api/v1/image-list api to support width and height filter

Implement the Component update scenario