lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lintel::sqlite::PreparedStatement Class Reference

#include <PreparedStatement.h>

Public Member Functions

 PreparedStatement (Connection &connection, const std::string &statement, const std::string &statementName)
 
 ~PreparedStatement ()
 
std::shared_ptr< Result > execute (const std::vector< std::string > &params)
 
void close ()
 

Detailed Description

format of prepared statement example: insert into table (..,..) values(?,?);

=> ? will be replace automatically with $1 and $2 => algorithm will automatically count the number of parameters

Constructor & Destructor Documentation

◆ PreparedStatement()

lintel::sqlite::PreparedStatement::PreparedStatement ( Connection &  connection,
const std::string &  statement,
const std::string &  statementName 
)

Prepares a statement on the given connection.

Parameters
connectionthe SQLite connection
statementthe SQL statement template with '?' placeholders
statementNamethe name for the prepared statement

◆ ~PreparedStatement()

lintel::sqlite::PreparedStatement::~PreparedStatement ( )

Member Function Documentation

◆ close()

void lintel::sqlite::PreparedStatement::close ( )

Closes the prepared statement.

◆ execute()

std::shared_ptr< Result > lintel::sqlite::PreparedStatement::execute ( const std::vector< std::string > &  params)

Executes the prepared statement with the given parameters.

Parameters
paramsthe parameter values as strings
Returns
shared pointer to the result

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