In this chapter, we are going to look at SQL in the big picture. In previous chapters, we discussed SQLite3, which is a small database for quick prototyping. But when it comes to a production grade application, people prefer MySQL or PostgreSQL. Both are well proven in the web application space. First, we will discuss the internals of PostgreSQL and then move on to writing database models in Go. We will then try to realize the URL shortening service with a solid example.
In this chapter, we will cover the following topics:
- Introduction to the PostgreSQL database
- Installing PostgreSQL and creating users and databases
- Learning about pq, a database driver in Go
- Implementing a URL shortening service with PostgreSQL and a Base62 algorithm
- Exploring the JSON store in PostgreSQL
- Introducing gorm, a powerful ORM for Go
- Implementation of an e-commerce...