Skip to content

Commit

Permalink
feat: rename Condition contrain
Browse files Browse the repository at this point in the history
  • Loading branch information
tr1v3r committed Sep 8, 2021
1 parent ce69864 commit c64b441
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion do.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (d *DO) underlyingDO() *DO { return d }
// underlyingDB return self.db
func (d *DO) underlyingDB() *gorm.DB { return d.db }

func (DO) ConditionTag() {}
func (DO) ConditionMark() {}

// Debug return a DO with db in debug mode
func (d *DO) Debug() Dao { return NewDO(d.db.Debug()) }
Expand Down
4 changes: 2 additions & 2 deletions field/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ func CompareSubQuery(op CompareOperate, column Expr, subQuery *gorm.DB) Expr {
type Value interface {
expr() clause.Expr

ConditionTag()
ConditionMark()
}

type val clause.Expr

func (v val) expr() clause.Expr { return clause.Expr(v) }
func (val) ConditionTag() {}
func (val) ConditionMark() {}

func Values(value interface{}) Value {
return val(clause.Expr{
Expand Down
4 changes: 2 additions & 2 deletions field/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type Expr interface {
Build(*gorm.Statement) sql
RawExpr() expression

ConditionTag()
ConditionMark()

expression() clause.Expression
}
Expand All @@ -35,7 +35,7 @@ type expr struct {
e clause.Expression
}

func (expr) ConditionTag() {}
func (expr) ConditionMark() {}

func (e expr) expression() clause.Expression {
if e.e == nil {
Expand Down
4 changes: 2 additions & 2 deletions interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
type (
// Condition query condition
// field.Expr and subquery are expect value
Condition interface{ ConditionTag() }
Condition interface{ ConditionMark() }

// Hint hints.Hints and hints.IndexHint are expect value
Hint clause.Expression
Expand All @@ -23,7 +23,7 @@ type subQuery interface {
underlyingDB() *gorm.DB
underlyingDO() *DO

ConditionTag()
ConditionMark()
}

// Dao CRUD methods
Expand Down

0 comments on commit c64b441

Please sign in to comment.