SQT
A C++ ORM framework for SQLite
Loading...
Searching...
No Matches

◆ MakeInserter() [2/2]

template<EntityValueType ENTITY>
template<ConflictAction CONFLICT_ACTION = ConflictAction::Abort, AssignmentType... ASSIGNMENTS>
constexpr auto sqt::DataContext< ENTITY >::MakeInserter ( ASSIGNMENTS &&... assignments)
staticconstexprnoexcept

Creates an inserter for inserting the specified columns of the entity into the database table.

Template Parameters
CONFLICT_ACTIONThe conflict action to be used when a unique constraint violation occurs. The default action is sqt::ConflictAction::Abort.
ASSIGNMENTSA pack of the assignment types.
Parameters
assignmentsThe assignments specifying the columns and their values to be inserted.
Returns
A new inserter instance.

This method provides more control over the inserted columns compared to the MakeInserter() method. It allows specifying which columns to insert and their corresponding values.

The MakeReplacer(ASSIGNMENTS&&...) method is a shorthand for MakeInserter<sqt::ConflictAction::Replace>(assignments).

For more information about the assignments, refer to the sqt::AssignmentType concept.

See also
sqt::AssignmentType
sqt::DataContext<>::MakeInserter()
sqt::DataContext<>::MakeReplacer(ASSIGNMENTS&&... assignments);