Common ODB Runtime Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
query-dynamic.hxx
Go to the documentation of this file.
1 // file : odb/query-dynamic.hxx
2 // copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
3 // license : GNU GPL v2; see accompanying LICENSE file
4 
5 #ifndef ODB_QUERY_DYNAMIC_HXX
6 #define ODB_QUERY_DYNAMIC_HXX
7 
8 #include <odb/pre.hxx>
9 
10 #include <string>
11 #include <vector>
12 #include <cstddef> // std::size_t
13 
14 #include <odb/forward.hxx>
15 #include <odb/query.hxx>
16 
17 #include <odb/details/export.hxx>
18 #include <odb/details/shared-ptr.hxx>
19 
20 namespace odb
21 {
22  struct native_column_info;
23 
24  template <typename T>
25  struct val_bind
26  {
27  typedef const T& type;
28 
29  explicit
30  val_bind (type v): val (v) {}
31 
33  };
34 
35  // Passing arrays by value in dynamic queries is not supported.
36  // Pass by reference instead.
37  //
38  template <typename T, std::size_t N>
39  struct val_bind<T[N]>;
40 
41  template <typename T>
42  struct ref_bind
43  {
44  typedef const T& type;
45 
46  explicit
47  ref_bind (type r): ref (r) {}
48 
49  const void*
50  ptr () const {return &ref;}
51 
53  };
54 
55  template <typename T, std::size_t N>
56  struct ref_bind<T[N]>
57  {
58  typedef const T* type;
59 
60  explicit
61  ref_bind (type r): ref (r) {}
62 
63  // Allow implicit conversion from decayed ref_bind's.
64  //
67 
68  const void*
69  ptr () const {return ref;}
70 
72  };
73 
74  //
75  //
76  struct LIBODB_EXPORT query_param: details::shared_base
77  {
78  virtual ~query_param ();
79  query_param (const void* v): value (v) {}
80 
81  const void* value;
82  };
83 
84  // For by-value parameters we have to make a copy since the original
85  // can be gone by the time we translate to native query.
86  //
87  template <typename T>
89  {
90  val_query_param (const T& v): query_param (&copy), copy (v) {}
91 
92  T copy;
93  };
94 
95  //
96  //
97  class LIBODB_EXPORT query_base
98  {
99  public:
100  // Internally the query clause is stored in a Reverse Polish Notation-
101  // like representation which also allows us to traverse it as a syntax
102  // tree.
103  //
104  // Let's keep this class POD so that std::vector can do more
105  // efficient copying, etc.
106  //
107  struct clause_part
108  {
109  // Note that the order of enumerators is important (used as indexes).
110  //
112  {
113  kind_column, // native_info points to the native_column_info array.
114 
115  kind_param_val, // data points to query_param while native_info points
116  kind_param_ref, // to the native_column_info array.
117 
118  kind_native, // data is the index in the strings vector.
119 
120  kind_true, // true literal.
121  kind_false, // false literal.
122 
123  // Operators.
124  //
125  // For binary operators, data is the index of the last element
126  // belonging to the left hand side sub-expression.
127  //
128  op_add, // + (concatenation of two sub-expressions)
129 
130  op_and, // &&
131  op_or, // ||
132  op_not, // !
133 
134  op_null, // is_null ()
135  op_not_null, // is_not_null ()
136 
137  op_in, // in(), data is the number of arguments
138  op_like, // like(pattern)
139  op_like_escape, // like(pattern, escape)
140 
141  op_eq, // ==
142  op_ne, // !=
143  op_lt, // <
144  op_gt, // >
145  op_le, // <=
146  op_ge // >=
147  };
148 
150  std::size_t data;
152  };
153 
154  public:
156  {
157  clear ();
158  }
159 
161 
162  // True or false literal.
163  //
164  explicit
165  query_base (bool v)
166  {
167  append (v ? clause_part::kind_true : clause_part::kind_false, 0);
168  }
169 
170  explicit
171  query_base (const char* native)
172  {
173  append (native);
174  }
175 
176  explicit
177  query_base (const std::string& native)
178  {
179  append (native);
180  }
181 
183 
185  {
186  append (x);
187  }
188 
189  query_base&
190  operator= (const query_base& x)
191  {
192  if (this != &x)
193  {
194  clear ();
195  append (x);
196  }
197 
198  return *this;
199  }
200 
201  public:
202  template <typename T>
203  static val_bind<T>
204  _val (const T& x)
205  {
206  return val_bind<T> (x);
207  }
208 
209  template <typename T>
210  static ref_bind<T>
211  _ref (const T& x)
212  {
213  return ref_bind<T> (x);
214  }
215 
216  // Some compilers (notably VC++), when deducing const T& from const
217  // array do not strip const from the array type. As a result, in the
218  // above signatures we get, for example, T = const char[4] instead
219  // of T = char[4], which is what we want. So to "fix" such compilers,
220  // we will have to provide the following specialization of the above
221  // _ref() function (we don't need _val() since we don't support passing
222  // arrays by value; see val_bind definition).
223  //
224  template <typename T, std::size_t N>
225  static ref_bind<T[N]>
226  _ref (const T (&x) [N])
227  {
228  return ref_bind<T[N]> (x);
229  }
230 
231  public:
232  query_base&
233  operator+= (const query_base&);
234 
235  query_base&
236  operator+= (const std::string& native);
237 
238  public:
239  bool
240  empty () const
241  {
242  return clause_.empty ();
243  }
244 
245  bool
246  const_true () const
247  {
248  return clause_.size () == 1 &&
249  clause_.front ().kind == clause_part::kind_true;
250  }
251 
252  // Implementation details.
253  //
254  public:
255  explicit
257  {
258  append (c);
259  }
260 
261  // Native.
262  //
263  void
264  append (const std::string&);
265 
266  // Query fragment.
267  //
268  void
269  append (const query_base&);
270 
271  // Operator.
272  //
273  void
274  append (clause_part::kind_type k, std::size_t data)
275  {
276  clause_.push_back (clause_part ());
277  clause_.back ().kind = k;
278  clause_.back ().data = data;
279  }
280 
281  // Column.
282  //
283  void
285  {
286  clause_.push_back (clause_part ());
287  clause_.back ().kind = clause_part::kind_column;
288  clause_.back ().native_info = c;
289  }
290 
291  // Parameter.
292  //
293  void
294  append_ref (const void* ref, const native_column_info*);
295 
296  template <typename T>
297  void
298  append_val (const T& val, const native_column_info*);
299 
300  void
301  clear ();
302 
303  public:
304  typedef std::vector<clause_part> clause_type;
305  typedef std::vector<std::string> strings_type;
306 
307  const clause_type&
308  clause () const
309  {
310  return clause_;
311  }
312 
313  const strings_type&
314  strings () const
315  {
316  return strings_;
317  }
318 
319  private:
320  clause_type clause_;
321  strings_type strings_;
322  };
323 
324  inline query_base
325  operator+ (const query_base& x, const query_base& y)
326  {
327  query_base r (x);
328  r += y;
329  return r;
330  }
331 
332  inline query_base
333  operator+ (const query_base& q, const std::string& s)
334  {
335  query_base r (q);
336  r += s;
337  return r;
338  }
339 
340  inline query_base
341  operator+ (const std::string& s, const query_base& q)
342  {
343  query_base r (s);
344  r += q;
345  return r;
346  }
347 
348  LIBODB_EXPORT query_base
349  operator&& (const query_base&, const query_base&);
350 
351  LIBODB_EXPORT query_base
352  operator|| (const query_base&, const query_base&);
353 
354  LIBODB_EXPORT query_base
355  operator! (const query_base&);
356 
357  //
358  //
360  {
361  const void* column;
363  };
364 
365  template <typename T>
366  const T&
367  type_instance ();
368 
369  // This class template has to remain POD since we rely on it being
370  // 0-initialized before any dynamic initialization takes place in
371  // any other translation unit.
372  //
373  template <typename T>
374  struct query_column
375  {
376  // Array of pointers to database-specific columns. It will be
377  // automatically zero-initialized since query_column instances
378  // are always static.
379  //
381 
382  // is_null, is_not_null
383  //
384  public:
385  query_base
386  is_null () const
387  {
390  return q;
391  }
392 
393  query_base
394  is_not_null () const
395  {
398  return q;
399  }
400 
401  // in
402  //
403  public:
404  query_base
405  in (const T&, const T&) const;
406 
407  query_base
408  in (const T&, const T&, const T&) const;
409 
410  query_base
411  in (const T&, const T&, const T&, const T&) const;
412 
413  query_base
414  in (const T&, const T&, const T&, const T&, const T&) const;
415 
416  template <typename I>
417  query_base
418  in_range (I begin, I end) const;
419 
420  // like
421  //
422  public:
423  query_base
424  like (const T& pattern) const
425  {
426  return like (val_bind<T> (pattern));
427  }
428 
429  query_base
430  like (val_bind<T> pattern) const;
431 
432  template <typename T2>
433  query_base
434  like (val_bind<T2> pattern) const
435  {
436  return like (val_bind<T> (T (pattern.val)));
437  }
438 
439  query_base
440  like (ref_bind<T> pattern) const;
441 
442  query_base
443  like (const T& pattern, const T& escape) const
444  {
445  return like (val_bind<T> (pattern), escape);
446  }
447 
448  query_base
449  like (val_bind<T> pattern, const T& escape) const;
450 
451  template <typename T2>
452  query_base
453  like (val_bind<T2> pattern, const T& escape) const
454  {
455  return like (val_bind<T> (T (pattern.val)), escape);
456  }
457 
458  query_base
459  like (ref_bind<T> pattern, const T& escape) const;
460 
461  // ==
462  //
463  public:
464  query_base
465  equal (val_bind<T> v) const
466  {
468  q.append_val (v.val, native_info);
470  return q;
471  }
472 
473  query_base
474  equal (ref_bind<T> r) const
475  {
477  q.append_ref (r.ptr (), native_info);
479  return q;
480  }
481 
482  friend query_base
483  operator== (const query_column& c, const T& v)
484  {
485  return c.equal (val_bind<T> (v));
486  }
487 
488  friend query_base
489  operator== (const T& v, const query_column& c)
490  {
491  return c.equal (val_bind<T> (v));
492  }
493 
494  friend query_base
496  {
497  return c.equal (v);
498  }
499 
500  friend query_base
502  {
503  return c.equal (v);
504  }
505 
506  template <typename T2>
507  friend query_base
509  {
510  return c.equal (val_bind<T> (T (v.val)));
511  }
512 
513  template <typename T2>
514  friend query_base
516  {
517  return c.equal (val_bind<T> (T (v.val)));
518  }
519 
520  friend query_base
522  {
523  return c.equal (r);
524  }
525 
526  friend query_base
528  {
529  return c.equal (r);
530  }
531 
532  // !=
533  //
534  public:
535  query_base
537  {
539  q.append_val (v.val, native_info);
541  return q;
542  }
543 
544  query_base
546  {
548  q.append_ref (r.ptr (), native_info);
550  return q;
551  }
552 
553  friend query_base
554  operator!= (const query_column& c, const T& v)
555  {
556  return c.unequal (val_bind<T> (v));
557  }
558 
559  friend query_base
560  operator!= (const T& v, const query_column& c)
561  {
562  return c.unequal (val_bind<T> (v));
563  }
564 
565  friend query_base
567  {
568  return c.unequal (v);
569  }
570 
571  friend query_base
573  {
574  return c.unequal (v);
575  }
576 
577  template <typename T2>
578  friend query_base
580  {
581  return c.unequal (val_bind<T> (T (v.val)));
582  }
583 
584  template <typename T2>
585  friend query_base
587  {
588  return c.unequal (val_bind<T> (T (v.val)));
589  }
590 
591  friend query_base
593  {
594  return c.unequal (r);
595  }
596 
597  friend query_base
599  {
600  return c.unequal (r);
601  }
602 
603  // <
604  //
605  public:
606  query_base
607  less (val_bind<T> v) const
608  {
610  q.append_val (v.val, native_info);
612  return q;
613  }
614 
615  query_base
616  less (ref_bind<T> r) const
617  {
619  q.append_ref (r.ptr (), native_info);
621  return q;
622  }
623 
624  friend query_base
625  operator< (const query_column& c, const T& v)
626  {
627  return c.less (val_bind<T> (v));
628  }
629 
630  friend query_base
631  operator< (const T& v, const query_column& c)
632  {
633  return c.greater (val_bind<T> (v));
634  }
635 
636  friend query_base
637  operator< (const query_column& c, val_bind<T> v)
638  {
639  return c.less (v);
640  }
641 
642  friend query_base
643  operator< (val_bind<T> v, const query_column& c)
644  {
645  return c.greater (v);
646  }
647 
648  template <typename T2>
649  friend query_base
650  operator< (const query_column& c, val_bind<T2> v)
651  {
652  return c.less (val_bind<T> (T (v.val)));
653  }
654 
655  template <typename T2>
656  friend query_base
657  operator< (val_bind<T2> v, const query_column& c)
658  {
659  return c.greater (val_bind<T> (T (v.val)));
660  }
661 
662  friend query_base
663  operator< (const query_column& c, ref_bind<T> r)
664  {
665  return c.less (r);
666  }
667 
668  friend query_base
669  operator< (ref_bind<T> r, const query_column& c)
670  {
671  return c.greater (r);
672  }
673 
674  // >
675  //
676  public:
677  query_base
679  {
681  q.append_val (v.val, native_info);
683  return q;
684  }
685 
686  query_base
688  {
690  q.append_ref (r.ptr (), native_info);
692  return q;
693  }
694 
695  friend query_base
696  operator> (const query_column& c, const T& v)
697  {
698  return c.greater (val_bind<T> (v));
699  }
700 
701  friend query_base
702  operator> (const T& v, const query_column& c)
703  {
704  return c.less (val_bind<T> (v));
705  }
706 
707  friend query_base
709  {
710  return c.greater (v);
711  }
712 
713  friend query_base
715  {
716  return c.less (v);
717  }
718 
719  template <typename T2>
720  friend query_base
722  {
723  return c.greater (val_bind<T> (T (v.val)));
724  }
725 
726  template <typename T2>
727  friend query_base
729  {
730  return c.less (val_bind<T> (T (v.val)));
731  }
732 
733  friend query_base
735  {
736  return c.greater (r);
737  }
738 
739  friend query_base
741  {
742  return c.less (r);
743  }
744 
745  // <=
746  //
747  public:
748  query_base
750  {
752  q.append_val (v.val, native_info);
754  return q;
755  }
756 
757  query_base
759  {
761  q.append_ref (r.ptr (), native_info);
763  return q;
764  }
765 
766  friend query_base
767  operator<= (const query_column& c, const T& v)
768  {
769  return c.less_equal (val_bind<T> (v));
770  }
771 
772  friend query_base
773  operator<= (const T& v, const query_column& c)
774  {
775  return c.greater_equal (val_bind<T> (v));
776  }
777 
778  friend query_base
779  operator<= (const query_column& c, val_bind<T> v)
780  {
781  return c.less_equal (v);
782  }
783 
784  friend query_base
785  operator<= (val_bind<T> v, const query_column& c)
786  {
787  return c.greater_equal (v);
788  }
789 
790  template <typename T2>
791  friend query_base
792  operator<= (const query_column& c, val_bind<T2> v)
793  {
794  return c.less_equal (val_bind<T> (T (v.val)));
795  }
796 
797  template <typename T2>
798  friend query_base
799  operator<= (val_bind<T2> v, const query_column& c)
800  {
801  return c.greater_equal (val_bind<T> (T (v.val)));
802  }
803 
804  friend query_base
805  operator<= (const query_column& c, ref_bind<T> r)
806  {
807  return c.less_equal (r);
808  }
809 
810  friend query_base
811  operator<= (ref_bind<T> r, const query_column& c)
812  {
813  return c.greater_equal (r);
814  }
815 
816  // >=
817  //
818  public:
819  query_base
821  {
823  q.append_val (v.val, native_info);
825  return q;
826  }
827 
828  query_base
830  {
832  q.append_ref (r.ptr (), native_info);
834  return q;
835  }
836 
837  friend query_base
838  operator>= (const query_column& c, const T& v)
839  {
840  return c.greater_equal (val_bind<T> (v));
841  }
842 
843  friend query_base
844  operator>= (const T& v, const query_column& c)
845  {
846  return c.less_equal (val_bind<T> (v));
847  }
848 
849  friend query_base
851  {
852  return c.greater_equal (v);
853  }
854 
855  friend query_base
857  {
858  return c.less_equal (v);
859  }
860 
861  template <typename T2>
862  friend query_base
864  {
865  return c.greater_equal (val_bind<T> (T (v.val)));
866  }
867 
868  template <typename T2>
869  friend query_base
871  {
872  return c.less_equal (val_bind<T> (T (v.val)));
873  }
874 
875  friend query_base
877  {
878  return c.greater_equal (r);
879  }
880 
881  friend query_base
883  {
884  return c.less_equal (r);
885  }
886 
887  // Column comparison.
888  //
889  public:
890  template <typename T2>
891  query_base
893  {
894  // We can compare columns only if we can compare their C++ types.
895  //
896  (void) (sizeof (type_instance<T> () == type_instance<T2> ()));
897 
899  q.append (c.native_info);
901  return q;
902  }
903 
904  template <typename T2>
905  query_base
907  {
908  // We can compare columns only if we can compare their C++ types.
909  //
910  (void) (sizeof (type_instance<T> () != type_instance<T2> ()));
911 
913  q.append (c.native_info);
915  return q;
916  }
917 
918  template <typename T2>
919  query_base
920  operator< (const query_column<T2>& c) const
921  {
922  // We can compare columns only if we can compare their C++ types.
923  //
924  (void) (sizeof (type_instance<T> () < type_instance<T2> ()));
925 
927  q.append (c.native_info);
929  return q;
930  }
931 
932  template <typename T2>
933  query_base
934  operator> (const query_column<T2>& c) const
935  {
936  // We can compare columns only if we can compare their C++ types.
937  //
938  (void) (sizeof (type_instance<T> () > type_instance<T2> ()));
939 
941  q.append (c.native_info);
943  return q;
944  }
945 
946  template <typename T2>
947  query_base
948  operator<= (const query_column<T2>& c) const
949  {
950  // We can compare columns only if we can compare their C++ types.
951  //
952  (void) (sizeof (type_instance<T> () <= type_instance<T2> ()));
953 
955  q.append (c.native_info);
957  return q;
958  }
959 
960  template <typename T2>
961  query_base
963  {
964  // We can compare columns only if we can compare their C++ types.
965  //
966  (void) (sizeof (type_instance<T> () >= type_instance<T2> ()));
967 
969  q.append (c.native_info);
971  return q;
972  }
973  };
974 
975  // Provide operator+() for using columns to construct native
976  // query fragments (e.g., ORDER BY).
977  //
978  template <typename T>
979  inline query_base
980  operator+ (const query_column<T>& c, const std::string& s)
981  {
982  query_base q (c.native_info);
983  q.append (s);
985  return q;
986  }
987 
988  template <typename T>
989  inline query_base
990  operator+ (const std::string& s, const query_column<T>& c)
991  {
992  query_base q (s);
993  q.append (c.native_info);
995  return q;
996  }
997 
998  template <typename T>
999  inline query_base
1001  {
1002  query_base r (c.native_info);
1003  r.append (q);
1005  return r;
1006  }
1007 
1008  template <typename T>
1009  inline query_base
1011  {
1012  query_base r (q);
1013  r.append (c.native_info);
1014  r.append (query_base::clause_part::op_add, q.clause ().size () - 1);
1015  return r;
1016  }
1017 
1018  //
1019  //
1020  template <typename T>
1021  class query<T, query_base>: public query_base,
1022  public query_selector<T, id_common>::columns_type
1023  {
1024  public:
1025  // We don't define any typedefs here since they may clash with
1026  // column names defined by our base type.
1027  //
1028 
1030  {
1031  }
1032 
1033  explicit
1034  query (bool v)
1035  : query_base (v)
1036  {
1037  }
1038 
1039  explicit
1040  query (const char* q)
1041  : query_base (q)
1042  {
1043  }
1044 
1045  explicit
1046  query (const std::string& q)
1047  : query_base (q)
1048  {
1049  }
1050 
1051  query (const query_base& q)
1052  : query_base (q)
1053  {
1054  }
1055 
1057  : query_base (qc)
1058  {
1059  }
1060  };
1061 }
1062 
1063 #include <odb/query-dynamic.ixx>
1064 #include <odb/query-dynamic.txx>
1065 
1066 #include <odb/post.hxx>
1067 
1068 #endif // ODB_QUERY_DYNAMIC_HXX
Definition: query-dynamic.hxx:138
Definition: query-dynamic.hxx:118
LIBODB_EXPORT query_base operator||(const query_base &, const query_base &)
void append_ref(const void *ref, const native_column_info *)
friend query_base operator!=(const query_column &c, const T &v)
Definition: query-dynamic.hxx:554
ref_bind(type r)
Definition: query-dynamic.hxx:61
Definition: forward.hxx:148
Definition: query-dynamic.hxx:107
void append(const native_column_info *c)
Definition: query-dynamic.hxx:284
friend query_base operator<(const query_column &c, const T &v)
Definition: query-dynamic.hxx:625
query_base is_not_null() const
Definition: query-dynamic.hxx:394
query_base(const char *native)
Definition: query-dynamic.hxx:171
Definition: query-dynamic.hxx:146
query_base like(const T &pattern) const
Definition: query-dynamic.hxx:424
Definition: query-dynamic.hxx:144
std::vector< std::string > strings_type
Definition: query-dynamic.hxx:305
query_base less(val_bind< T > v) const
Definition: query-dynamic.hxx:607
query_base equal(ref_bind< T > r) const
Definition: query-dynamic.hxx:474
query_base unequal(val_bind< T > v) const
Definition: query-dynamic.hxx:536
query_base greater(ref_bind< T > r) const
Definition: query-dynamic.hxx:687
query(const query_column< bool > &qc)
Definition: query-dynamic.hxx:1056
Definition: query-dynamic.hxx:120
Definition: query-dynamic.hxx:116
const strings_type & strings() const
Definition: query-dynamic.hxx:314
native_column_info native_info[database_count]
Definition: query-dynamic.hxx:380
LIBODB_EXPORT query_base operator&&(const query_base &, const query_base &)
query_base less(ref_bind< T > r) const
Definition: query-dynamic.hxx:616
query_base less_equal(val_bind< T > v) const
Definition: query-dynamic.hxx:749
static ref_bind< T[N]> _ref(const T(&x)[N])
Definition: query-dynamic.hxx:226
Definition: query-dynamic.hxx:76
Definition: query-dynamic.hxx:143
const std::size_t database_count
Definition: forward.hxx:87
query(const query_base &q)
Definition: query-dynamic.hxx:1051
bool const_true() const
Definition: query-dynamic.hxx:246
query_base equal(val_bind< T > v) const
Definition: query-dynamic.hxx:465
void * param_factory
Definition: query-dynamic.hxx:362
T copy
Definition: query-dynamic.hxx:92
friend query_base operator>=(const query_column &c, const T &v)
Definition: query-dynamic.hxx:838
Definition: query-dynamic.hxx:135
const native_column_info * native_info
Definition: query-dynamic.hxx:151
const T & type
Definition: query-dynamic.hxx:27
query(const std::string &q)
Definition: query-dynamic.hxx:1046
query_base is_null() const
Definition: query-dynamic.hxx:386
void append_val(const T &val, const native_column_info *)
ref_bind(ref_bind< const T * > r)
Definition: query-dynamic.hxx:66
query_base(const query_base &x)
Definition: query-dynamic.hxx:184
Definition: query.hxx:110
kind_type
Definition: query-dynamic.hxx:111
const T * type
Definition: query-dynamic.hxx:58
query_base(const std::string &native)
Definition: query-dynamic.hxx:177
query(bool v)
Definition: query-dynamic.hxx:1034
Definition: query-dynamic.hxx:97
Definition: query-dynamic.hxx:42
kind_type kind
Definition: query-dynamic.hxx:149
query_base like(const T &pattern, const T &escape) const
Definition: query-dynamic.hxx:443
query_base less_equal(ref_bind< T > r) const
Definition: query-dynamic.hxx:758
query_base greater(val_bind< T > v) const
Definition: query-dynamic.hxx:678
ref_bind(type r)
Definition: query-dynamic.hxx:47
const void * value
Definition: query-dynamic.hxx:81
LIBODB_EXPORT query_base operator!(const query_base &)
static ref_bind< T > _ref(const T &x)
Definition: query-dynamic.hxx:211
Definition: query-dynamic.hxx:121
Definition: query-dynamic.hxx:88
const T & type_instance()
Definition: query-dynamic.hxx:134
friend query_base operator>(const query_column &c, const T &v)
Definition: query-dynamic.hxx:696
Definition: query-dynamic.hxx:130
Definition: query-dynamic.hxx:128
Definition: query-dynamic.hxx:141
const void * column
Definition: query-dynamic.hxx:361
query_base greater_equal(val_bind< T > v) const
Definition: query-dynamic.hxx:820
Definition: query-dynamic.hxx:139
static val_bind< T > _val(const T &x)
Definition: query-dynamic.hxx:204
query()
Definition: query-dynamic.hxx:1029
void append(const std::string &)
Definition: query-dynamic.hxx:113
query_base unequal(ref_bind< T > r) const
Definition: query-dynamic.hxx:545
ref_bind(ref_bind< T * > r)
Definition: query-dynamic.hxx:65
query_base operator+(const query_base &x, const query_base &y)
Definition: query-dynamic.hxx:325
Definition: query.hxx:104
Definition: query-dynamic.hxx:137
Definition: query-dynamic.hxx:131
Definition: query-dynamic.hxx:115
type ref
Definition: query-dynamic.hxx:52
Definition: query-dynamic.hxx:25
query_base(const native_column_info *c)
Definition: query-dynamic.hxx:256
friend query_base operator==(const query_column &c, const T &v)
Definition: query-dynamic.hxx:483
friend query_base operator<=(const query_column &c, const T &v)
Definition: query-dynamic.hxx:767
const void * ptr() const
Definition: query-dynamic.hxx:50
Definition: query-dynamic.hxx:56
Definition: query-dynamic.hxx:359
Definition: query-dynamic.hxx:132
const T & type
Definition: query-dynamic.hxx:44
query_base greater_equal(ref_bind< T > r) const
Definition: query-dynamic.hxx:829
query_base(bool v)
Definition: query-dynamic.hxx:165
query_base like(val_bind< T2 > pattern) const
Definition: query-dynamic.hxx:434
std::size_t data
Definition: query-dynamic.hxx:150
query_base in(const T &, const T &) const
query_param(const void *v)
Definition: query-dynamic.hxx:79
val_bind(type v)
Definition: query-dynamic.hxx:30
type val
Definition: query-dynamic.hxx:32
query(const char *q)
Definition: query-dynamic.hxx:1040
query_base like(val_bind< T2 > pattern, const T &escape) const
Definition: query-dynamic.hxx:453
val_query_param(const T &v)
Definition: query-dynamic.hxx:90
const clause_type & clause() const
Definition: query-dynamic.hxx:308
Definition: query-dynamic.hxx:142
~query_base()
Definition: query-dynamic.hxx:155
bool empty() const
Definition: query-dynamic.hxx:240
query_base in_range(I begin, I end) const
const void * ptr() const
Definition: query-dynamic.hxx:69
query_base()
Definition: query-dynamic.hxx:160
std::vector< clause_part > clause_type
Definition: query-dynamic.hxx:304
Definition: query-dynamic.hxx:145
void append(clause_part::kind_type k, std::size_t data)
Definition: query-dynamic.hxx:274
type ref
Definition: query-dynamic.hxx:71