StormByte-Database 2.0.0
C++26 database module of the StormByte suite
 
Loading...
Searching...
No Matches
StormByte::Database::MSSQL::PreparedSTMT Class Referencefinal

A logical SQL statement executed through sp_executesql RPC. More...

#include <StormByte/database/mssql/prepared_stmt.hxx>

Inheritance diagram for StormByte::Database::MSSQL::PreparedSTMT:
Collaboration diagram for StormByte::Database::MSSQL::PreparedSTMT:

Public Member Functions

 PreparedSTMT (const PreparedSTMT &)=delete
 Deleted copy constructor.
 
 PreparedSTMT (PreparedSTMT &&other) noexcept
 Move constructor.
 
 ~PreparedSTMT () noexcept override
 Release statement-owned state.
 
PreparedSTMT & operator= (const PreparedSTMT &)=delete
 Deleted copy assignment.
 
PreparedSTMT & operator= (PreparedSTMT &&other) noexcept
 Move assignment.
 
 PreparedSTMT (ConstructionKey key, std::string_view name, std::string_view query, struct tds_dblib_dbprocess *connection, const StormByte::Safe::Shared< Logger::Log > &logger, const StormByte::Safe::Shared< StormByte::Database::Telemetry > &telemetry)
 Construct through MSSQL statement factory.
 
- Public Member Functions inherited from StormByte::Database::PreparedSTMT
 PreparedSTMT (std::string_view name, std::string_view query, const StormByte::Safe::Shared< Logger::Log > &logger)
 Copy name, query and logger.
 
 PreparedSTMT (std::string_view name, std::string_view query, const StormByte::Safe::Shared< Logger::Log > &logger, const StormByte::Safe::Shared< Telemetry > &telemetry)
 Copy statement metadata and share connection telemetry.
 
 PreparedSTMT (const PreparedSTMT &other)=delete
 Copy constructor (deleted).
 
 PreparedSTMT (PreparedSTMT &&other) noexcept
 Move constructor.
 
PreparedSTMT & operator= (const PreparedSTMT &other)=delete
 Copy assignment (deleted).
 
PreparedSTMT & operator= (PreparedSTMT &&other) noexcept
 Move assignment.
 
template<typename... Args>
ExpectedRows Execute (Args &&...args)
 Bind arguments and execute.
 
std::string_view Name () const noexcept
 Statement name.
 
std::string_view Query () const noexcept
 SQL text.
 

Friends

class MSSQL
 

Additional Inherited Members

- Protected Member Functions inherited from StormByte::Database::PreparedSTMT
void RecordBackendEvent (BackendEvent event) noexcept
 Record a backend event against the owning connection.
 
template<typename T >
void Bind (StormByte::Size index, T &&value) noexcept
 Bind a value at index.
 
void Bind (StormByte::Size index, std::nullptr_t) noexcept
 Bind SQL NULL at index.
 
- Protected Attributes inherited from StormByte::Database::PreparedSTMT
StormByte::Safe::Shared< Logger::Log > m_logger
 Shared logger, safe across the DLL boundary.
 
StormByte::Safe::Shared< Telemetry > m_telemetry
 Shared connection telemetry.
 

Detailed Description

A logical SQL statement executed through sp_executesql RPC.

Constructor & Destructor Documentation

◆ PreparedSTMT() [1/3]

StormByte::Database::MSSQL::PreparedSTMT::PreparedSTMT ( const PreparedSTMT &  )
delete

Deleted copy constructor.

◆ PreparedSTMT() [2/3]

StormByte::Database::MSSQL::PreparedSTMT::PreparedSTMT ( PreparedSTMT &&  other)
noexcept

Move constructor.

Parameters
otherStatement to move from.

◆ ~PreparedSTMT()

StormByte::Database::MSSQL::PreparedSTMT::~PreparedSTMT ( )
overridevirtualnoexcept

Release statement-owned state.

Reimplemented from StormByte::Database::PreparedSTMT.

◆ PreparedSTMT() [3/3]

StormByte::Database::MSSQL::PreparedSTMT::PreparedSTMT ( ConstructionKey  key,
std::string_view  name,
std::string_view  query,
struct tds_dblib_dbprocess *  connection,
const StormByte::Safe::Shared< Logger::Log > &  logger,
const StormByte::Safe::Shared< StormByte::Database::Telemetry > &  telemetry 
)

Construct through MSSQL statement factory.

Parameters
keyFactory-only key.
nameStatement name.
querySQL text.
connectionDB-Library process.
loggerOptional logger.
telemetryConnection telemetry.

Member Function Documentation

◆ operator=() [1/2]

PreparedSTMT & StormByte::Database::MSSQL::PreparedSTMT::operator= ( const PreparedSTMT &  )
delete

Deleted copy assignment.

◆ operator=() [2/2]

PreparedSTMT & StormByte::Database::MSSQL::PreparedSTMT::operator= ( PreparedSTMT &&  other)
noexcept

Move assignment.

Parameters
otherStatement to move from.
Returns
This statement.

Friends And Related Symbol Documentation

◆ MSSQL

friend class MSSQL
friend

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