1
0
mirror of https://github.com/aclindsa/moneygo.git synced 2025-07-02 20:28:38 -04:00

Rebind all SQL queries to acommodate Postgres

This commit is contained in:
2017-11-16 21:29:36 -05:00
parent f9c234c2f3
commit 00e1e899c0
2 changed files with 66 additions and 3 deletions

View File

@ -14,8 +14,6 @@ type ResponseWriterWriter interface {
Write(http.ResponseWriter) error
}
type Tx = gorp.Transaction
type Context struct {
Tx *Tx
User *User
@ -51,7 +49,7 @@ type APIHandler struct {
}
func (ah *APIHandler) txWrapper(h Handler, r *http.Request, context *Context) (writer ResponseWriterWriter) {
tx, err := ah.DB.Begin()
tx, err := GetTx(ah.DB)
if err != nil {
log.Print(err)
return NewError(999 /*Internal Error*/)