Skip to content

Commit

Permalink
use safe query
Browse files Browse the repository at this point in the history
  • Loading branch information
bohdand-weka committed Jul 8, 2024
1 parent 3c0cf3a commit 5a1d685
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions orm/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ func (q *Query) AppendColumn(columns ...string) *Query {
t := q.tableModel.Table()
if q.columns == nil {
for _, f := range t.Fields {
q.columns = append(q.columns, fieldAppender{fmt.Sprintf("%s.%s", t.Alias, f.SQLName)})
q.columns = append(q.columns, SafeQuery("?.?", t.Alias, f.Column))
}
}
return q.Column(columns...)
Expand All @@ -378,7 +378,7 @@ func (q *Query) AppendColumnExpr(expr string, params ...interface{}) *Query {
t := q.tableModel.Table()
if q.columns == nil {
for _, f := range t.Fields {
q.columns = append(q.columns, fieldAppender{fmt.Sprintf("%s.%s", t.Alias, f.SQLName)})
q.columns = append(q.columns, SafeQuery("?.?", t.Alias, f.Column))
}
}
return q.ColumnExpr(expr, params...)
Expand Down

0 comments on commit 5a1d685

Please sign in to comment.