Lightweight 0.1.0
Loading...
Searching...
No Matches
SqlUpdateQueryBuilder Class Referencefinal

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 >
SqlUpdateQueryBuilderSet (std::string_view columnName, ColumnValue const &value)
 Adds a single column to the SET clause.
 
template<std::size_t N>
SqlUpdateQueryBuilderSet (std::string_view columnName, char const (&value)[N])
 Adds a single column to the SET clause with the value being a string literal.
 
SqlUpdateQueryBuilderSet (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.
 

Detailed Description

Query builder for building UPDATE ... queries.

Definition at line 14 of file Update.hpp.

Constructor & Destructor Documentation

◆ SqlUpdateQueryBuilder()

SqlUpdateQueryBuilder::SqlUpdateQueryBuilder ( SqlQueryFormatter const &  formatter,
std::string  table,
std::string  tableAlias,
std::vector< SqlVariant > *  inputBindings 
)
inlinenoexcept

Constructs a new SqlUpdateQueryBuilder object.

Parameters
formatterThe SQL query formatter to use. One of SqlServerQueryFormatter, OracleSqlQueryFormatter, PostgreSqlFormatter
tableThe name of the table to update.
tableAliasThe alias of the table to update.
inputBindingsThe input bindings to use for the query.

Definition at line 24 of file Update.hpp.

Member Function Documentation

◆ SearchCondition()

SqlSearchCondition & SqlUpdateQueryBuilder::SearchCondition ( )
inlinenoexcept

Definition at line 36 of file Update.hpp.

◆ Formatter()

SqlQueryFormatter const & SqlUpdateQueryBuilder::Formatter ( ) const
inlinenoexcept

Returns the SQL query formatter.

Definition at line 42 of file Update.hpp.

◆ Set()

template<typename ColumnValue >
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().


The documentation for this class was generated from the following file: