diff --git a/internal/db/db.go b/internal/db/db.go index ad3ea78..68cfd6d 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -3,12 +3,12 @@ package db import ( "database/sql" "fmt" + "github.com/aclindsa/gorp" "github.com/aclindsa/moneygo/internal/config" "github.com/aclindsa/moneygo/internal/handlers" _ "github.com/go-sql-driver/mysql" _ "github.com/lib/pq" _ "github.com/mattn/go-sqlite3" - "gopkg.in/gorp.v2" "log" "strings" ) @@ -25,7 +25,9 @@ func GetDbMap(db *sql.DB, dbtype config.DbType) (*gorp.DbMap, error) { Encoding: "UTF8", } } else if dbtype == config.Postgres { - dialect = gorp.PostgresDialect{} + dialect = gorp.PostgresDialect{ + LowercaseFields: true, + } } else { return nil, fmt.Errorf("Don't know gorp dialect to go with '%s' DB type", dbtype.String()) } diff --git a/internal/handlers/handlers.go b/internal/handlers/handlers.go index 67f5672..e42419d 100644 --- a/internal/handlers/handlers.go +++ b/internal/handlers/handlers.go @@ -1,7 +1,7 @@ package handlers import ( - "gopkg.in/gorp.v2" + "github.com/aclindsa/gorp" "log" "net/http" "path" diff --git a/internal/handlers/tx.go b/internal/handlers/tx.go index 716abf0..c0db452 100644 --- a/internal/handlers/tx.go +++ b/internal/handlers/tx.go @@ -2,7 +2,7 @@ package handlers import ( "database/sql" - "gopkg.in/gorp.v2" + "github.com/aclindsa/gorp" "strings" )