From b580f1548ff335a0e1fa004fc6626486535c94e1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 21 Feb 2013 11:07:25 +0200 Subject: Add support for pattern matching (SQL LIKE) --- odb/sqlite/query.hxx | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'odb/sqlite/query.hxx') diff --git a/odb/sqlite/query.hxx b/odb/sqlite/query.hxx index b6d5bb9..31bd922 100644 --- a/odb/sqlite/query.hxx +++ b/odb/sqlite/query.hxx @@ -741,6 +741,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 (pattern)); + } + + query_base + like (val_bind pattern) const; + + template + query_base + like (val_bind pattern) const + { + return like (val_bind (decayed_type (pattern.val))); + } + + query_base + like (ref_bind pattern) const; + + query_base + like (decayed_type pattern, decayed_type escape) const + { + return like (val_bind (pattern), escape); + } + + query_base + like (val_bind pattern, decayed_type escape) const; + + template + query_base + like (val_bind pattern, decayed_type escape) const + { + return like (val_bind (decayed_type (pattern.val)), escape); + } + + query_base + like (ref_bind pattern, decayed_type escape) const; + // = // public: -- cgit v1.1