In this chapter, we are going to take a bird's-eye view of SQL. In the previous chapters, we discussed SQLite3, which is a lightweight database for quick prototyping. But when it comes to developing an enterprise-grade application, MySQL or PostgreSQL is the preferred choice. Both are well-proven, heavy-duty databases that are open source. In this chapter, we'll pick PostgreSQL as our main subject.
First, we'll discuss the internals of PostgreSQL, and then move on to use the database with Go. The goal of this chapter is to make the reader comfortable working with PostgreSQL and Go. We'll also build a URL-shortening service that requires a database layer.
In this chapter, we will cover the following topics:
- Discussing PostgreSQL installation options
- Introducing pq, a pure PostgreSQL database driver for Go
- Implementing a...