Lightweight 0.20260303.0
Loading...
Searching...
No Matches
Lightweight::SqlMigrationUpdateBuilder Class Referencefinal

Query builder for building UPDATE queries in migrations. More...

#include <Migrate.hpp>

Public Member Functions

 SqlMigrationUpdateBuilder (SqlUpdateDataPlan &plan)
 Constructs a migration UPDATE builder.
 
template<typename T >
SqlMigrationUpdateBuilderSet (std::string columnName, T const &value)
 Sets a column value for the UPDATE.
 
SqlMigrationUpdateBuilderSetExpression (std::string columnName, std::string expression)
 Sets a column to a raw SQL expression — for column-to-column copies or arithmetic that cannot be represented as a literal value.
 
template<typename T >
SqlMigrationUpdateBuilderWhere (std::string columnName, std::string op, T const &value)
 Adds a WHERE condition to the UPDATE.
 
SqlMigrationUpdateBuilderWhereExpression (std::string expression)
 Supplies a pre-rendered WHERE-clause body for cases that don't fit the simple (column, op, value) form — composite AND/OR/NOT, IS NULL, IN (subquery), EXISTS (subquery), etc.
 

Detailed Description

Query builder for building UPDATE queries in migrations.

See also
SqlMigrationQueryBuilder

Definition at line 375 of file Migrate.hpp.

Constructor & Destructor Documentation

◆ SqlMigrationUpdateBuilder()

Lightweight::SqlMigrationUpdateBuilder::SqlMigrationUpdateBuilder ( SqlUpdateDataPlan plan)
inlineexplicit

Constructs a migration UPDATE builder.

Definition at line 379 of file Migrate.hpp.

Member Function Documentation

◆ Set()

template<typename T >
SqlMigrationUpdateBuilder & Lightweight::SqlMigrationUpdateBuilder::Set ( std::string  columnName,
T const &  value 
)
inline

Sets a column value for the UPDATE.

Definition at line 386 of file Migrate.hpp.

◆ SetExpression()

SqlMigrationUpdateBuilder & Lightweight::SqlMigrationUpdateBuilder::SetExpression ( std::string  columnName,
std::string  expression 
)
inline

Sets a column to a raw SQL expression — for column-to-column copies or arithmetic that cannot be represented as a literal value.

Parameters
columnNameThe target column.
expressionThe raw SQL fragment (e.g. "OTHER_COL", "CTR" + 1) emitted verbatim after the =. The caller is responsible for any identifier quoting.

Definition at line 399 of file Migrate.hpp.

◆ Where()

template<typename T >
SqlMigrationUpdateBuilder & Lightweight::SqlMigrationUpdateBuilder::Where ( std::string  columnName,
std::string  op,
T const &  value 
)
inline

Adds a WHERE condition to the UPDATE.

Definition at line 407 of file Migrate.hpp.

◆ WhereExpression()

SqlMigrationUpdateBuilder & Lightweight::SqlMigrationUpdateBuilder::WhereExpression ( std::string  expression)
inline

Supplies a pre-rendered WHERE-clause body for cases that don't fit the simple (column, op, value) form — composite AND/OR/NOT, IS NULL, IN (subquery), EXISTS (subquery), etc.

The text is emitted verbatim after WHERE at execution time; the caller is responsible for dialect-safe quoting.

Parameters
expressionPre-rendered SQL clause body (without the leading WHERE).

Definition at line 422 of file Migrate.hpp.


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