-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
…mTag
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
package sqlbuilder | ||
|
||
import ( | ||
"bytes" | ||
"reflect" | ||
"strings" | ||
) | ||
|
@@ -147,7 +148,19 @@ func (s *Struct) SelectFromForTag(table string, tag string) *SelectBuilder { | |
|
||
if ok { | ||
fields = s.quoteFields(fields) | ||
sb.Select(EscapeAll(fields...)...) | ||
|
||
buf := &bytes.Buffer{} | ||
cols := make([]string, 0, len(fields)) | ||
|
||
for _, field := range fields { | ||
buf.WriteString(table) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
huandu
Author
Owner
|
||
buf.WriteRune('.') | ||
buf.WriteString(field) | ||
cols = append(cols, buf.String()) | ||
buf.Reset() | ||
} | ||
|
||
sb.Select(cols...) | ||
} else { | ||
sb.Select("*") | ||
} | ||
|
It seems like
table
doesn't support alias, such as 'user u'