1
0
mirror of https://github.com/astaxie/beego.git synced 2024-12-22 16:00:50 +00:00

Merge pull request #4114 from wangle201210/develop-2.0

Add the operator(>,>=,<,<=,=,!=) of orm
This commit is contained in:
Ming Deng 2020-07-30 16:51:02 +08:00 committed by GitHub
commit 71776e4bef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 0 deletions

View File

@ -49,6 +49,12 @@ var (
"eq": true,
"nq": true,
"ne": true,
">": true,
">=": true,
"<": true,
"<=": true,
"=": true,
"!=": true,
"startswith": true,
"endswith": true,
"istartswith": true,

View File

@ -29,11 +29,17 @@ var mysqlOperators = map[string]string{
// "regex": "REGEXP BINARY ?",
// "iregex": "REGEXP ?",
"gt": "> ?",
">": "> ?",
"gte": ">= ?",
">=": ">= ?",
"lt": "< ?",
"<": "< ?",
"lte": "<= ?",
"<=": "<= ?",
"eq": "= ?",
"=": "= ?",
"ne": "!= ?",
"!=": "!= ?",
"startswith": "LIKE BINARY ?",
"endswith": "LIKE BINARY ?",
"istartswith": "LIKE ?",

View File

@ -22,10 +22,15 @@ import (
// oracle operators.
var oracleOperators = map[string]string{
"exact": "= ?",
"=": "= ?",
"gt": "> ?",
">": "> ?",
"gte": ">= ?",
">=": ">= ?",
"lt": "< ?",
"<": "< ?",
"lte": "<= ?",
"<=": "<= ?",
"//iendswith": "LIKE ?",
}

View File

@ -26,11 +26,17 @@ var postgresOperators = map[string]string{
"contains": "LIKE ?",
"icontains": "LIKE UPPER(?)",
"gt": "> ?",
">": "> ?",
"gte": ">= ?",
">=": ">= ?",
"lt": "< ?",
"<": "< ?",
"lte": "<= ?",
"<=": "<= ?",
"eq": "= ?",
"=": "= ?",
"ne": "!= ?",
"!=": "!= ?",
"startswith": "LIKE ?",
"endswith": "LIKE ?",
"istartswith": "LIKE UPPER(?)",

View File

@ -28,11 +28,17 @@ var sqliteOperators = map[string]string{
"contains": "LIKE ? ESCAPE '\\'",
"icontains": "LIKE ? ESCAPE '\\'",
"gt": "> ?",
">": "> ?",
"gte": ">= ?",
">=": ">= ?",
"lt": "< ?",
"<": "< ?",
"lte": "<= ?",
"<=": "<= ?",
"eq": "= ?",
"=": "= ?",
"ne": "!= ?",
"!=": "!= ?",
"startswith": "LIKE ? ESCAPE '\\'",
"endswith": "LIKE ? ESCAPE '\\'",
"istartswith": "LIKE ? ESCAPE '\\'",