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

#include <Statement.h>

Public Member Functions

 Statement (const Connection &connection)
 
Result execute (const std::string &query)
 
Result execute (const std::string &query, const db::ParameterBuilder &builder)
 
Cursor executeCursor (const std::string &query)
 
Cursor executeCursor (const std::string &query, const db::ParameterBuilder &builder)
 

Detailed Description

Unified statement execution wrapping PostgreSQL or SQLite statements.

Constructor & Destructor Documentation

◆ Statement()

lintel::db::Statement::Statement ( const Connection &  connection)
explicit

Constructs a Statement bound to the given connection.

Parameters
connectionthe database connection

Member Function Documentation

◆ execute() [1/2]

Result lintel::db::Statement::execute ( const std::string &  query)

Executes a plain SQL query.

Parameters
querythe SQL query string
Returns
the query result

◆ execute() [2/2]

Result lintel::db::Statement::execute ( const std::string &  query,
const db::ParameterBuilder &  builder 
)

Executes a parameterized SQL query.

Parameters
querythe SQL query string with placeholders
builderthe parameter builder containing parameter values
Returns
the query result

◆ executeCursor() [1/2]

Cursor lintel::db::Statement::executeCursor ( const std::string &  query)

Executes a plain SQL query as a streaming cursor.

Parameters
querythe SQL query string
Returns
the cursor; the connection must outlive it

◆ executeCursor() [2/2]

Cursor lintel::db::Statement::executeCursor ( const std::string &  query,
const db::ParameterBuilder &  builder 
)

Executes a parameterized SQL query as a streaming cursor.

Parameters
querythe SQL query string with placeholders
builderthe parameter builder containing parameter values
Returns
the cursor; the connection must outlive it

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