Skip to content

Commit

Permalink
feat: ban column raw mode
Browse files Browse the repository at this point in the history
  • Loading branch information
tr1v3r committed Sep 21, 2021
1 parent 5976a50 commit ce0e6b6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion field/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ import (

type FieldOption func(clause.Column) clause.Column

var (
banColumnRaw FieldOption = func(col clause.Column) clause.Column {
col.Raw = false
return col
}
)

// TODO implement validator options

// ======================== generic field =======================
Expand Down Expand Up @@ -97,7 +104,7 @@ func toColumn(table, column string, opts ...FieldOption) clause.Column {
for _, opt := range opts {
col = opt(col)
}
return col
return banColumnRaw(col)
}

// ======================== boolean operate ========================
Expand Down

0 comments on commit ce0e6b6

Please sign in to comment.