Lightweight 0.1.0
|
Query builder for building UPDATE ... queries. More...
#include <Update.hpp>
Inherits SqlWhereClauseBuilder< SqlUpdateQueryBuilder >.
Public Member Functions | |
SqlUpdateQueryBuilder (SqlQueryFormatter const &formatter, std::string table, std::string tableAlias, std::vector< SqlVariant > *inputBindings) noexcept | |
SqlSearchCondition & | SearchCondition () noexcept |
SqlQueryFormatter const & | Formatter () const noexcept |
Returns the SQL query formatter. | |
template<typename ColumnValue > | |
SqlUpdateQueryBuilder & | Set (std::string_view columnName, ColumnValue const &value) |
Adds a single column to the SET clause. | |
template<std::size_t N> | |
SqlUpdateQueryBuilder & | Set (std::string_view columnName, char const (&value)[N]) |
Adds a single column to the SET clause with the value being a string literal. | |
SqlUpdateQueryBuilder & | Set (std::string_view columnName, MFCStringLike auto const *value) |
Adds a single column to the SET clause with the value being a MFC like CString. | |
std::string | ToSql () const |
Finalizes building the query as UPDATE ... query. | |
Query builder for building UPDATE ... queries.
Definition at line 14 of file Update.hpp.
|
inlinenoexcept |
Constructs a new SqlUpdateQueryBuilder object.
formatter | The SQL query formatter to use. One of SqlServerQueryFormatter, OracleSqlQueryFormatter, PostgreSqlFormatter |
table | The name of the table to update. |
tableAlias | The alias of the table to update. |
inputBindings | The input bindings to use for the query. |
Definition at line 24 of file Update.hpp.
|
inlinenoexcept |
Definition at line 36 of file Update.hpp.
|
inlinenoexcept |
Returns the SQL query formatter.
Definition at line 42 of file Update.hpp.
SqlUpdateQueryBuilder & SqlUpdateQueryBuilder::Set | ( | std::string_view | columnName, |
ColumnValue const & | value | ||
) |
Adds a single column to the SET clause.
Definition at line 68 of file Update.hpp.
References SqlQueryFormatter::StringLiteral().