diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-02-21 11:07:25 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-02-21 11:09:52 +0200 |
commit | 90786906ee3bce15c83445c0ba25a69a6b7e115d (patch) | |
tree | 28b5051153b11b9d9f662ca4e7afce47504b4b28 /odb/pgsql/query-dynamic.cxx | |
parent | 9a8e7d08c12b51407b8aa710fd4ca8cdf8842669 (diff) |
Add support for pattern matching (SQL LIKE)
Diffstat (limited to 'odb/pgsql/query-dynamic.cxx')
-rw-r--r-- | odb/pgsql/query-dynamic.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/odb/pgsql/query-dynamic.cxx b/odb/pgsql/query-dynamic.cxx index ba38758..bd2c949 100644 --- a/odb/pgsql/query-dynamic.cxx +++ b/odb/pgsql/query-dynamic.cxx @@ -110,6 +110,22 @@ namespace odb q += ")"; break; } + case part::op_like: + { + translate (q, s, p - 2); // column + q += "LIKE"; + translate (q, s, p - 1); // pattern + break; + } + case part::op_like_escape: + { + translate (q, s, p - 3); // column + q += "LIKE"; + translate (q, s, p - 2); // pattern + q += "ESCAPE"; + translate (q, s, p - 1); // escape + break; + } case part::op_eq: case part::op_ne: case part::op_lt: |