From bbb6f31f1604abf411abbcef6ce452da6188103f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A9=BA=E8=A7=81?= Date: Tue, 9 Jun 2015 10:18:21 +0800 Subject: [PATCH] support eq&ne for orm --- orm/db.go | 2 ++ orm/db_mysql.go | 2 ++ orm/db_postgres.go | 2 ++ orm/db_sqlite.go | 2 ++ 4 files changed, 8 insertions(+) diff --git a/orm/db.go b/orm/db.go index 060d83bc..20dc80f2 100644 --- a/orm/db.go +++ b/orm/db.go @@ -44,6 +44,8 @@ var ( "gte": true, "lt": true, "lte": true, + "eq": true, + "nq": true, "startswith": true, "endswith": true, "istartswith": true, diff --git a/orm/db_mysql.go b/orm/db_mysql.go index 3c2ad3a4..182914a2 100644 --- a/orm/db_mysql.go +++ b/orm/db_mysql.go @@ -30,6 +30,8 @@ var mysqlOperators = map[string]string{ "gte": ">= ?", "lt": "< ?", "lte": "<= ?", + "eq": "= ?", + "ne": "!= ?", "startswith": "LIKE BINARY ?", "endswith": "LIKE BINARY ?", "istartswith": "LIKE ?", diff --git a/orm/db_postgres.go b/orm/db_postgres.go index 296ee6a0..6500ef52 100644 --- a/orm/db_postgres.go +++ b/orm/db_postgres.go @@ -29,6 +29,8 @@ var postgresOperators = map[string]string{ "gte": ">= ?", "lt": "< ?", "lte": "<= ?", + "eq": "= ?", + "ne": "!= ?", "startswith": "LIKE ?", "endswith": "LIKE ?", "istartswith": "LIKE UPPER(?)", diff --git a/orm/db_sqlite.go b/orm/db_sqlite.go index 0a2f32c8..c2dcbb46 100644 --- a/orm/db_sqlite.go +++ b/orm/db_sqlite.go @@ -29,6 +29,8 @@ var sqliteOperators = map[string]string{ "gte": ">= ?", "lt": "< ?", "lte": "<= ?", + "eq": "= ?", + "ne": "!= ?", "startswith": "LIKE ? ESCAPE '\\'", "endswith": "LIKE ? ESCAPE '\\'", "istartswith": "LIKE ? ESCAPE '\\'",