The essential part of working with the database is the connection to the database itself. The Go standard package covers only the abstraction on how the interaction with the database works, and a third-party driver must be used.
In this recipe, we will show how to connect to the PostgreSQL database. However, the approach is applicable to all other databases whose driver implements the standard API.