Each database server has its own specifics and also, the protocols are different. Naturally, the communication with the database within the language library must be customized to work with the specific protocol.
The Go standard library provides a unified API for communication and operations on the database server. This API is located in the sql package. To use the specific database server, the driver must be imported. This driver needs to be sql package-compliant. This way, you will be able to benefit from the unified approach. In this chapter, we will describe the basics of database operations, transaction handling, and finally, how to use the stored procedures. Note that we are going to illustrate the approach on the PostgreSQL database, but the approaches are applicable to most other databases.