Skip to content

Commit

Permalink
some documentation updates, add docs for NameMapper and make sqlx's p…
Browse files Browse the repository at this point in the history
…ackage line conform to other packages when running via godoc
  • Loading branch information
jmoiron committed Oct 5, 2013
1 parent 3875d9d commit a19990a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// General purpose extensions to database/sql
// Package SQLX provides general purpose extensions to database/sql.t
//
// sqlx is intended to seamlessly wrap database/sql and provide convenience
// methods which are useful in the development of database driven applications.
Expand Down
4 changes: 4 additions & 0 deletions sqlx.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import (
"strings"
)

// NameMapper is used to map column names to struct field names. By default,
// it uses strings.ToLower to lowercase struct field names. It can be set
// to whatever you want, but it is encouraged to be set before sqlx is used
// as field-to-name mappings are cached after first use on a type.
var NameMapper = strings.ToLower

// A wrapper around sql.Rows which caches costly reflect operations
Expand Down

0 comments on commit a19990a

Please sign in to comment.