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.hxx | |
parent | 9a8e7d08c12b51407b8aa710fd4ca8cdf8842669 (diff) |
Add support for pattern matching (SQL LIKE)
Diffstat (limited to 'odb/pgsql/query.hxx')
-rw-r--r-- | odb/pgsql/query.hxx | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/odb/pgsql/query.hxx b/odb/pgsql/query.hxx index 266e733..acfede0 100644 --- a/odb/pgsql/query.hxx +++ b/odb/pgsql/query.hxx @@ -730,6 +730,47 @@ namespace odb query_base in_range (I begin, I end) const; + // like + // + public: + query_base + like (decayed_type pattern) const + { + return like (val_bind<T> (pattern)); + } + + query_base + like (val_bind<T> pattern) const; + + template <typename T2> + query_base + like (val_bind<T2> pattern) const + { + return like (val_bind<T> (decayed_type (pattern.val))); + } + + query_base + like (ref_bind<T> pattern) const; + + query_base + like (decayed_type pattern, decayed_type escape) const + { + return like (val_bind<T> (pattern), escape); + } + + query_base + like (val_bind<T> pattern, decayed_type escape) const; + + template <typename T2> + query_base + like (val_bind<T2> pattern, decayed_type escape) const + { + return like (val_bind<T> (decayed_type (pattern.val)), escape); + } + + query_base + like (ref_bind<T> pattern, decayed_type escape) const; + // = // public: |