mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
service/reflect: add more debug logs
This commit is contained in:
parent
dfe29e07e7
commit
fb63346732
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/fatih/camelcase"
|
||||
gopluralize "github.com/gertd/go-pluralize"
|
||||
"github.com/jmoiron/sqlx"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var pluralize = gopluralize.NewClient()
|
||||
|
@ -188,11 +189,13 @@ func insertType(db *sqlx.DB, record interface{}) error {
|
|||
|
||||
func selectAndScanType(ctx context.Context, db *sqlx.DB, sel squirrel.SelectBuilder, tpe interface{}) (interface{}, error) {
|
||||
sql, args, err := sel.ToSql()
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
logrus.Debugf("selectAndScanType: %T <- %s", tpe, sql)
|
||||
logrus.Debugf("queryArgs: %v", args)
|
||||
|
||||
rows, err := db.QueryxContext(ctx, sql, args...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in New Issue
Block a user