SQT
A C++ ORM framework for SQLite
Loading...
Searching...
No Matches
sqt::ExpressionLike Concept Reference

#include <sqt/orm/expression/expression_like.h>

Description

Constrains a type to be an expression-like type.

Requirements

  • The type must have a static constant ParameterCount of type std::size_t, representing the number of parameters in the expression (including inline parameters and placeholders).
  • The type must have a static method BuildPlaceholderBinders() with the following signature:
    auto BuildPlaceholderBinders(int parameter_index);
    The return type must satisfy the sqt::BinderTupleType concept. This method creates binders for placeholders in the expression, starting from the given parameter index.
  • The type must have a static method BuildSQL() with the following signature:
    std::string BuildSQL();
    This method creates a string representing the expression in SQL.
  • The type must have a member method BindInlineParameters() with the following signature:
    void BindInlineParameters(Statement& statement, int parameter_index) const;
    Wrapper class for SQLite statement.
    Definition statement.h:21
    This method binds inline parameters in the expression to the SQL statement, starting from the given parameter index.

This concept defines the common requirements for expression-like types, which are used in various circumstances require expressions. There are several concepts for more specific expression types defined in the framework:

See also
sqt::AssignmentType
sqt::BinderTupleType
sqt::OrderingTermType
sqt::OperandType
sqt::PredicateType