Represents a sql query condition. More...
#include <condition.hpp>
Public Member Functions | |
condition () | |
condition (const std::string &c) | |
template<class T > | |
condition & | equal (const T &val) |
template<class T > | |
condition & | not_equal (const T &val) |
template<class T > | |
condition & | greater (const T &val) |
template<class T > | |
condition & | greater_equal (const T &val) |
template<class T > | |
condition & | less (const T &val) |
template<class T > | |
condition & | less_equal (const T &val) |
condition & | not_null () |
condition & | null () |
condition & | or_ (const condition &cond) |
condition & | and_ (const condition &cond) |
std::string | str (bool prepared) const |
std::string | column () const |
unsigned long | size () const |
data_type_t | type () const |
bool | valid () const |
Detailed Description
Represents a sql query condition.
This class represents a condition part of a sql query or update statement. Each compare method returns a reference to the condition itself. That way one can concatenate conditions together.
Constructor & Destructor Documentation
|
inline |
Creates an empty unknown condition.
|
inline |
Creates a new condition for the given column c
- Parameters
-
c The column name.
Member Function Documentation
Concatenate to conditions with logical and.
- Returns
- A reference to the condition.
|
inline |
Returns the column name.
- Returns
- Returns the column name.
|
inline |
Evalutes the value of the column with the given value to equal.
- Template Parameters
-
T The type of the value.
- Parameters
-
val The value to compares
- Returns
- A reference to the condition.
|
inline |
Evalutes the value of the column with the given value to greater than.
- Template Parameters
-
T The type of the value.
- Parameters
-
val The value to compares
- Returns
- A reference to the condition.
|
inline |
Evalutes the value of the column with the given value to equal or greater than.
- Template Parameters
-
T The type of the value.
- Parameters
-
val The value to compares
- Returns
- A reference to the condition.
|
inline |
Evalutes the value of the column with the given value to less than.
- Template Parameters
-
T The type of the value.
- Parameters
-
val The value to compares
- Returns
- A reference to the condition.
|
inline |
Evalutes the value of the column with the given value to equal or less than.
- Template Parameters
-
T The type of the value.
- Parameters
-
val The value to compares
- Returns
- A reference to the condition.
|
inline |
Evalutes the value of the column with the given value to not equal.
- Template Parameters
-
T The type of the value.
- Parameters
-
val The value to compares
- Returns
- A reference to the condition.
|
inline |
Evalutes the value of the column to not null.
- Returns
- A reference to the condition.
|
inline |
Evalutes the value of the column to null.
- Returns
- A reference to the condition.
Concatenate to conditions with logical or.
- Returns
- A reference to the condition.
|
inline |
Returns the size of the data
- Returns
- The size of the data.
|
inline |
Returns the string representation of the condition. With the prepared flag set to true the condition string is put together for preppared statements.
- Parameters
-
prepared Indicates wether the condition is for prepared statements or not.
- Returns
- A reference to the condition.
|
inline |
Returns the data type.
- Returns
- The data type.
|
inline |
Returns wether the condition is in a valid state. This means a column name, an operator and a value must be set.
- Returns
- True if the condition is in a valid state.
The documentation for this class was generated from the following file:
- database/condition.hpp