From e8fcc49c37b9008e7ed0fd42d33d708f4da12c6a Mon Sep 17 00:00:00 2001 From: antao Date: Wed, 5 Dec 2018 09:50:36 +0800 Subject: [PATCH] Add the 'like' to the Criteria class --- .travis.yml | 2 ++ orm_lib/inc/drogon/orm/Criteria.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.travis.yml b/.travis.yml index a937f78d..0d53c3a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ addons: - uuid-dev - zlib1g-dev - postgresql-server-dev-10 + - libmariadbclient-dev - openssl - libssl-dev - build-essential @@ -30,6 +31,7 @@ addons: - libtool - lz4 - postgresql + - mariadb script: - ./build.sh diff --git a/orm_lib/inc/drogon/orm/Criteria.h b/orm_lib/inc/drogon/orm/Criteria.h index 45e968f6..fa1b10a9 100644 --- a/orm_lib/inc/drogon/orm/Criteria.h +++ b/orm_lib/inc/drogon/orm/Criteria.h @@ -33,6 +33,7 @@ enum class CompareOperator GE, LT, LE, + LIKE, IsNull, IsNotNull }; @@ -67,6 +68,9 @@ class Criteria case CompareOperator::LE: _condString += " <= $?"; break; + case CompareOperator::LIKE: + _condString += " like $?"; + break; case CompareOperator::IsNull: case CompareOperator::IsNotNull: default: