userver: storages::odbc::ParameterStore Class Reference
Loading...
Searching...
No Matches
storages::odbc::ParameterStore Class Referencefinal

#include </data/code/userver/odbc/include/userver/storages/odbc/parameter_store.hpp>

Detailed Description

Owning, ordered list of dynamically assembled ODBC parameters.

Values are copied into the store and remain valid independently of the source objects. Use an empty std::optional<T> for SQL NULL: T determines the parameter type used for ODBC binding. Raw nullptr and std::nullopt remain untyped, just like in the variadic API, and should only be used when the driver can infer the type from the statement. A null const char* is a typed string NULL.

Warning
Parameters are always values for existing ? placeholders. Never interpolate them into the SQL query text.

Definition at line 37 of file parameter_store.hpp.

Public Member Functions

 ParameterStore (const ParameterStore &)=delete
 ParameterStore (ParameterStore &&) noexcept=default
ParameterStore & operator= (const ParameterStore &)=delete
ParameterStore & operator= (ParameterStore &&) noexcept=default
template<typename T>
requires impl::kIsParameterArgument<T>
ParameterStore & PushBack (const T &parameter)
 Copies a scalar parameter or the declaration-order fields of a supported aggregate to the end of the ordered list.
bool IsEmpty () const noexcept
 Returns whether the parameter list is empty.
std::size_t Size () const noexcept
 Returns the number of stored parameters.

Member Function Documentation

◆ IsEmpty()

bool storages::odbc::ParameterStore::IsEmpty ( ) const
inlinenoexcept

Returns whether the parameter list is empty.

Definition at line 62 of file parameter_store.hpp.

◆ PushBack()

template<typename T>
requires impl::kIsParameterArgument<T>
ParameterStore & storages::odbc::ParameterStore::PushBack ( const T & parameter)
inline

Copies a scalar parameter or the declaration-order fields of a supported aggregate to the end of the ordered list.

Returns
*this for chained construction.

Definition at line 50 of file parameter_store.hpp.

◆ Size()

std::size_t storages::odbc::ParameterStore::Size ( ) const
inlinenoexcept

Returns the number of stored parameters.

Definition at line 65 of file parameter_store.hpp.

◆ BulkParameterStore

friend class BulkParameterStore
friend

Definition at line 70 of file parameter_store.hpp.

◆ Cluster

friend class Cluster
friend

Definition at line 68 of file parameter_store.hpp.

◆ Transaction

friend class Transaction
friend

Definition at line 69 of file parameter_store.hpp.


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