EqFold to do value lower case
This commit is contained in:
8
pgm.go
8
pgm.go
@@ -104,10 +104,12 @@ func (f Field) Eq(val any) Conditioner {
|
|||||||
return &Cond{Field: col, Val: val, op: " = $", len: len(col) + 5}
|
return &Cond{Field: col, Val: val, op: " = $", len: len(col) + 5}
|
||||||
}
|
}
|
||||||
|
|
||||||
// EqualFold will user LOWER() for comparision
|
// EqualFold will use LOWER(column_name) = val for comparision
|
||||||
func (f Field) EqFold(val any) Conditioner {
|
//
|
||||||
|
// strings.ToLower(val) will pefromed on the provide val
|
||||||
|
func (f Field) EqFold(val string) Conditioner {
|
||||||
col := f.String()
|
col := f.String()
|
||||||
return &Cond{Field: "LOWER(" + col + ")", Val: val, op: " = LOWER($", action: CondActionNeedToClose, len: len(col) + 5}
|
return &Cond{Field: "LOWER(" + col + ")", Val: strings.ToLower(val), op: " = LOWER($", action: CondActionNeedToClose, len: len(col) + 5}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f Field) NEq(val any) Conditioner {
|
func (f Field) NEq(val any) Conditioner {
|
||||||
|
Reference in New Issue
Block a user