Пример #1
0
Файл: db.go Проект: mantyr/y
func sqlize(q sq.Sqlizer) (sql string, args []interface{}) {
	sql, args, _ = q.ToSql()
	if Debug {
		log.Printf("y/db: SQL: %s, args: %#v", sql, args)
	}
	return
}
Пример #2
0
// build converts the provided sql builder `b` into the sql and args to execute
// against the raw database connections.
func (r *Repo) build(b sq.Sqlizer) (sql string, args []interface{}, err error) {
	sql, args, err = b.ToSql()

	if err != nil {
		err = errors.Wrap(err, "to-sql failed")
	}
	return
}