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

◆ BindValue()

template<NullableValueType T>
void sqt::NullableValueTraits< T >::BindValue ( Statement & statement,
int parameter_index,
const T & value )
static

Binds a nullable value to the statement at the specified parameter index.

Parameters
statementThe statement to which the value is bound.
parameter_indexThe index of the parameter to which the value is bound.
valueThe nullable value to bind.
Exceptions
sqt::SQLErrorThrown if the binding fails.

If the value is null, this method calls the BindParameter(int, std::nullopt_t) method of the statement to bind a null. Otherwise, it delegates to the BindValue() method of the corresponding sqt::PrimitiveValueTraits<> specialization to bind the underlying value.

See also
sqt::PrimitiveValueTraits<INTEGER>::BindValue()
sqt::PrimitiveValueTraits<FLOAT>::BindValue()
sqt::PrimitiveValueTraits<std::string>::BindValue()
sqt::Statement::BindParameter(int, std::nullopt_t)