LiteSQL
updatequery.hpp
Go to the documentation of this file.
1 /* LiteSQL
2  *
3  * The list of contributors at http://litesql.sf.net/
4  *
5  * See LICENSE for copyright information. */
6 
7 #ifndef _litesql_updatequery_hpp
8 #define _litesql_updatequery_hpp
9 
10 #include "litesql/utils.hpp"
11 #include "litesql/expr.hpp"
14 namespace litesql {
15 
18 class UpdateQuery {
19  std::string table;
20  std::string _where;
21  std::vector<std::string> fields;
22  std::vector<std::string> values;
23 public:
24  UpdateQuery(const std::string& t) : table(t), _where("True") {}
25  UpdateQuery& where(const Expr& e);
26  UpdateQuery& set(const FieldType& f, const std::string& value);
27  operator std::string() const;
28  std::string asString() const { return this->operator std::string(); }
29 };
30 }
31 
32 #endif
litesql::UpdateQuery
a class that helps creating UPDATE-SQL statements.
Definition: updatequery.hpp:18
utils.hpp
litesql::join
std::string join(const std::vector< std::string > &strings, const std::string &delim=" ")
returns strings joined with delimiter
updatequery.hpp
expr.hpp
litesql::FieldType
Definition: field.hpp:25
litesql::Expr
A base class for expression in WHERE - clause.
Definition: expr.hpp:18
litesql::escapeSQL
std::string escapeSQL(const std::string &str)
escapes ' characters so that they do not break SQL statements.

SourceForge.net Logo