Original post

Reading this article from Alex Edwards in option 3b. there is a *sql.DB for the struct BookModel:

type BookModel struct {
        DB *sql.DB

Which is initiated in main like this:

db, err := sql.Open("postgres", "postgres://user:pass@localhost/bookstore")
env := &Env{
                books: models.BookModel{DB: db},

What if there are more than the one Book model? What is there are 200 models? Am I supposed to open a *sql.DB for each and every model? Afaik postgres only allows 100 or so simultaneous connections.