Good day,
Trying to dive into Revel framework stuff. And just have faced something which seems strange to me. Trying to find out how to use Postgres.
There is a reference app (booking) which is using GorpController. And GorpController
imports db module. But what is the profit of db module usage if both the controller and the db module are almost similar?
Examples are plentiful:
type GorpController struct {
*r.Controller
Txn *gorp.Transaction // The only difference we have gorp.Transaction here
}
and:
type Transactional struct {
*revel.Controller
Txn *sql.Tx
}
And then we have 3 absolutely identical methods in both files, they are func (...) Begin() r.Result
, func (...) Commit() r.Result
, and func (...) Rollback() r.Result
.
So why do we need db module if we are redefining most of the things in our controller?