Skip to content

Commit

Permalink
used QLatin1String() for some operators
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Nov 21, 2022
1 parent 482eeba commit 194b5e4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/orm/query/grammars/postgresgrammar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ const QVector<QString> &PostgresGrammar::getOperators() const
{
static const QVector<QString> cachedOperators {
EQ, LT, GT, LE, GE, NE, NE_,
LIKE, NLIKE, "between", ILIKE, "not ilike",
LIKE, NLIKE, QLatin1String("between"), ILIKE, QLatin1String("not ilike"),
"~", B_AND, B_OR, "#", "<<", ">>", "<<=", ">>=",
AND_, "@>", "<@", "?", "?|", "?&", OR_, "-", "@?", "@@", "#-",
"is distinct from", "is not distinct from",
AND_, "@>", "<@", "?", "?|", "?&", OR_, MINUS, "@?", "@@", "#-",
QLatin1String("is distinct from"), QLatin1String("is not distinct from"),
};

return cachedOperators;
Expand Down
2 changes: 1 addition & 1 deletion src/orm/query/grammars/sqlitegrammar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const QVector<QString> &SQLiteGrammar::getOperators() const
static const QVector<QString> cachedOperators {
EQ, LT, GT, LE, GE, NE_, NE,
LIKE, NLIKE, ILIKE,
B_AND, B_OR, "<<", ">>",
B_AND, B_OR, QLatin1String("<<"), QLatin1String(">>"),
};

return cachedOperators;
Expand Down
11 changes: 6 additions & 5 deletions src/orm/query/querybuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1735,12 +1735,13 @@ void Builder::checkBindingType(const BindingType type) const
const QVector<QString> &Builder::getOperators()
{
static const QVector<QString> cachedOperators {
EQ, LT, GT, LE, GE, NE_, NE, "<=>",
LIKE, "like binary", NLIKE, ILIKE,
EQ, LT, GT, LE, GE, NE_, NE, QLatin1String("<=>"),
LIKE, QLatin1String("like binary"), NLIKE, ILIKE,
B_AND, B_OR, "^", "<<", ">>", "&~",
"rlike", "not rlike", "regexp", "not regexp",
"~", "~*", "!~", "!~*", "similar to",
"not similar to", "not ilike", "~~*", "!~~*",
QLatin1String("rlike"), QLatin1String("not rlike"),
QLatin1String("regexp"), QLatin1String("not regexp"),
"~", "~*", "!~", "!~*", QLatin1String("similar to"),
QLatin1String("not similar to"), QLatin1String("not ilike"), "~~*", "!~~*",
};

return cachedOperators;
Expand Down

0 comments on commit 194b5e4

Please sign in to comment.