Skip to content

Commit

Permalink
Fix postgres mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
vkuznecovas committed Sep 25, 2020
1 parent ffd066f commit 2e03d32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion db/sqlxDriver/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/jmoiron/sqlx"
"github.com/jmoiron/sqlx/reflectx"

// We absolutely need the postgres driver here, this whole file depends on it
_ "github.com/lib/pq"
"github.com/vkuznecovas/mouthful/config/model"
Expand Down Expand Up @@ -81,7 +82,9 @@ func CreateDatabase(databaseConfig model.Database) (abstraction.Database, error)
return nil, err
}
db.Mapper = reflectx.NewMapperTagFunc("db",
nil,
func(s string) string {
return s
},
func(s string) string {
return strings.ToLower(s)
},
Expand Down

0 comments on commit 2e03d32

Please sign in to comment.