Skip to content

Commit

Permalink
feat: like
Browse files Browse the repository at this point in the history
  • Loading branch information
qqxhb committed Sep 27, 2023
1 parent d18f8d3 commit c2a0b2f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion field/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (field Field) Lte(value driver.Valuer) Expr {
}

// Like ...
func (field Field) Like(value driver.Valuer) Expr {
func (field Field) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

Expand Down
8 changes: 4 additions & 4 deletions field/float.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ func (field Float64) NotBetween(left float64, right float64) Expr {
}

// Like ...
func (field Float64) Like(value float64) Expr {
func (field Float64) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Float64) NotLike(value float64) Expr {
func (field Float64) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down Expand Up @@ -182,12 +182,12 @@ func (field Float32) NotBetween(left float32, right float32) Expr {
}

// Like ...
func (field Float32) Like(value float32) Expr {
func (field Float32) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Float32) NotLike(value float32) Expr {
func (field Float32) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down
40 changes: 20 additions & 20 deletions field/int.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ func (field Int) NotBetween(left int, right int) Expr {
}

// Like ...
func (field Int) Like(value int) Expr {
func (field Int) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Int) NotLike(value int) Expr {
func (field Int) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down Expand Up @@ -214,12 +214,12 @@ func (field Int8) NotBetween(left int8, right int8) Expr {
}

// Like ...
func (field Int8) Like(value int8) Expr {
func (field Int8) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Int8) NotLike(value int8) Expr {
func (field Int8) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down Expand Up @@ -370,12 +370,12 @@ func (field Int16) NotBetween(left int16, right int16) Expr {
}

// Like ...
func (field Int16) Like(value int16) Expr {
func (field Int16) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Int16) NotLike(value int16) Expr {
func (field Int16) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down Expand Up @@ -526,12 +526,12 @@ func (field Int32) NotBetween(left int32, right int32) Expr {
}

// Like ...
func (field Int32) Like(value int32) Expr {
func (field Int32) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Int32) NotLike(value int32) Expr {
func (field Int32) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down Expand Up @@ -682,12 +682,12 @@ func (field Int64) NotBetween(left int64, right int64) Expr {
}

// Like ...
func (field Int64) Like(value int64) Expr {
func (field Int64) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Int64) NotLike(value int64) Expr {
func (field Int64) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down Expand Up @@ -838,12 +838,12 @@ func (field Uint) NotBetween(left uint, right uint) Expr {
}

// Like ...
func (field Uint) Like(value uint) Expr {
func (field Uint) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Uint) NotLike(value uint) Expr {
func (field Uint) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down Expand Up @@ -994,12 +994,12 @@ func (field Uint8) NotBetween(left uint8, right uint8) Expr {
}

// Like ...
func (field Uint8) Like(value uint8) Expr {
func (field Uint8) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Uint8) NotLike(value uint8) Expr {
func (field Uint8) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down Expand Up @@ -1150,12 +1150,12 @@ func (field Uint16) NotBetween(left uint16, right uint16) Expr {
}

// Like ...
func (field Uint16) Like(value uint16) Expr {
func (field Uint16) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Uint16) NotLike(value uint16) Expr {
func (field Uint16) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down Expand Up @@ -1306,12 +1306,12 @@ func (field Uint32) NotBetween(left uint32, right uint32) Expr {
}

// Like ...
func (field Uint32) Like(value uint32) Expr {
func (field Uint32) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Uint32) NotLike(value uint32) Expr {
func (field Uint32) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down Expand Up @@ -1462,12 +1462,12 @@ func (field Uint64) NotBetween(left uint64, right uint64) Expr {
}

// Like ...
func (field Uint64) Like(value uint64) Expr {
func (field Uint64) Like(value string) Expr {
return expr{e: clause.Like{Column: field.RawExpr(), Value: value}}
}

// NotLike ...
func (field Uint64) NotLike(value uint64) Expr {
func (field Uint64) NotLike(value string) Expr {
return expr{e: clause.Not(field.Like(value).expression())}
}

Expand Down

0 comments on commit c2a0b2f

Please sign in to comment.