diff --git a/README.md b/README.md index 0386ffa2..a24d14cd 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ Yet Another ORM library for Go, aims for developer friendly ## TODO -* Or query -* Not query * Better First method (First(&user, primary_key, where conditions)) * Even more complex where query (with map or struct) * ORM.Errors diff --git a/orm.go b/orm.go index b37793a2..1c3558d0 100644 --- a/orm.go +++ b/orm.go @@ -20,7 +20,6 @@ type Orm struct { driver string whereClause []map[string]interface{} orClause []map[string]interface{} - notClause []map[string]interface{} selectStr string orderStrs []string offsetStr string @@ -151,11 +150,6 @@ func (s *Orm) Or(querystring interface{}, args ...interface{}) *Orm { return s } -func (s *Orm) Not(querystring interface{}, args ...interface{}) *Orm { - s.notClause = append(s.notClause, map[string]interface{}{"query": querystring, "args": args}) - return s -} - func (s *Orm) CreateTable(value interface{}) *Orm { s.explain(value, "CreateTable").Exec() return s diff --git a/orm_test.go b/orm_test.go index 81bf676e..69b2b1d8 100644 --- a/orm_test.go +++ b/orm_test.go @@ -280,9 +280,4 @@ func TestOrAndNot(t *testing.T) { if len(users) != 3 { t.Errorf("Should find three users with name 1 and 3") } - - db.Where("name = ?", "3").Not("age = ?", 22).Find(&users) - if len(users) != 3 { - t.Errorf("Should find three users with name 1 and 3") - } } diff --git a/sql.go b/sql.go index 30f537ff..5692ba9b 100644 --- a/sql.go +++ b/sql.go @@ -204,10 +204,6 @@ func (s *Orm) whereSql() (sql string) { and_conditions = append(and_conditions, s.buildWhereCondition(clause)) } - for _, clause := range s.notClause { - and_conditions = append(and_conditions, "!"+s.buildWhereCondition(clause)) - } - for _, clause := range s.orClause { or_conditions = append(or_conditions, s.buildWhereCondition(clause)) }