|
lintel 0.2.0
|
#include <PreparedStatement.h>
Public Member Functions | |
| PreparedStatement (const Connection &connection, const std::string &statement, const std::string &statementName) | |
| ~PreparedStatement ()=default | |
| Result | execute (const ParameterBuilder &builder) |
| void | close () |
Static Public Member Functions | |
| static constexpr int32_t | initNParams (std::string_view tempStatement) |
| static std::string | initStatement (const std::string &tempStatement) |
Unified prepared statement wrapping PostgreSQL or SQLite prepared statements.
|
explicit |
Prepares a statement on the given connection.
| connection | the database connection |
| statement | the SQL statement template |
| statementName | the name for the prepared statement |
|
default |
| void lintel::db::PreparedStatement::close | ( | ) |
Closes the prepared statement and frees associated resources.
| Result lintel::db::PreparedStatement::execute | ( | const ParameterBuilder & | builder | ) |
Executes the prepared statement with the given parameters.
| builder | the parameter builder containing parameter values |
|
inlinestaticconstexpr |
Counts the number of parameter placeholders in a statement template.
| tempStatement | the statement template with '?' placeholders |
|
static |
Converts a statement template with '?' placeholders to the native format.
| tempStatement | the statement template |