#include <userver/storages/query.hpp>
Holds a query, its name and logging mode; used by all the SQL databases of userver.
Prefer using via Embedding SQL/YQL files via userver_add_sql_library or use a const variable with name specified as NameLiteral.
Classes | |
| class | NameLiteral |
| Compile time literal with query name. More... | |
Public Types | |
| enum class | LogMode : unsigned char { kFull , kNameOnly } |
| using | Name = utils::StrongTypedef<struct NameTag, std::string> |
| String with query name. | |
| using | NameView = utils::zstring_view |
| Zero terminated view to the query name. | |
Public Member Functions | |
| Query (const Query &other)=default | |
| Query (Query &&other)=default | |
| constexpr | Query (utils::StringLiteral statement, NameLiteral name, LogMode log_mode=LogMode::kFull) |
| Constructor that omits dynamic initialization and relies on statement and name being string literals. | |
| Query (const char *statement, std::optional< Name > name=std::nullopt, LogMode log_mode=LogMode::kFull) | |
| Query (std::string statement, std::optional< Name > name=std::nullopt, LogMode log_mode=LogMode::kFull) | |
| Query & | operator= (const Query &other)=default |
| Query & | operator= (Query &&other)=default |
| std::optional< NameView > | GetOptionalNameView () const noexcept |
| std::optional< Name > | GetOptionalName () const |
| utils::zstring_view | GetStatementView () const noexcept |
| LogMode | GetLogMode () const noexcept |
| using storages::Query::Name = utils::StrongTypedef<struct NameTag, std::string> |
|
strong |
|
inlineconstexpr |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
noexcept |
|
noexcept |