O'Reilly logo

Go Standard Library Cookbook by Radomir Sohlich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introduction

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required