Cppgres
Build Postgres extensions in C++
Loading...
Searching...
No Matches
cppgres::spi_executor Struct Reference

SPI executor API More...

#include <executor.hpp>

Inheritance diagram for cppgres::spi_executor:
cppgres::executor cppgres::spi_nonatomic_executor

Classes

struct  options
 
struct  result_iterator
 
struct  results
 

Public Member Functions

 spi_executor ()
 Creates an SPI executor.
 
template<typename Ret , convertible_into_nullable_datum_and_has_a_type... Args>
results< Ret > query (utils::convertible_to_cstring auto query, Args &&...args)
 Queries using a string view.
 
template<typename Ret , convertible_into_nullable_datum_and_has_a_type... Args>
results< Ret > query (utils::convertible_to_cstring auto query, options &&opts, Args &&...args)
 Queries using a string view.
 
template<convertible_into_nullable_datum_and_has_a_type... Args>
spi_plan< Args... > plan (utils::convertible_to_cstring auto query)
 
template<typename Ret , convertible_into_nullable_datum... Args>
results< Ret > query (spi_plan< Args... > &query, Args &&...args)
 
template<typename Ret , convertible_into_nullable_datum... Args>
results< Ret > query (spi_plan< Args... > &query, options &&opts, Args &&...args)
 
template<convertible_into_nullable_datum_and_has_a_type... Args>
uint64_t execute (std::string_view query, Args &&...args)
 
template<convertible_into_nullable_datum_and_has_a_type... Args>
uint64_t execute (std::string_view query, options &&opts, Args &&...args)
 

Protected Member Functions

 spi_executor (int flags)
 

Static Protected Attributes

static std::stack< spi_executor * > executors
 

Detailed Description

SPI executor API

Member Function Documentation

◆ query() [1/2]

template<typename Ret , convertible_into_nullable_datum_and_has_a_type... Args>
results< Ret > cppgres::spi_executor::query ( utils::convertible_to_cstring auto  query,
Args &&...  args 
)
inline

Queries using a string view.

Parameters
queryQuery string
argsQuery arguments
Note
if you need to be able to configure the execution, use another version of the function with cppgres::spi_executor::options argument
Returns
Iterable cppgres::spi_executor::results, can be a single value
Exceptions
std::runtime_errorif there's another SPI executor in scope
std::runtime_errorif there's an SPI error

◆ query() [2/2]

template<typename Ret , convertible_into_nullable_datum_and_has_a_type... Args>
results< Ret > cppgres::spi_executor::query ( utils::convertible_to_cstring auto  query,
options &&  opts,
Args &&...  args 
)
inline

Queries using a string view.

Parameters
queryQuery string
optsExecution options
argsQuery arguments
Returns
Iterable cppgres::spi_executor::results, can be a single value
Exceptions
std::runtime_errorif there's another SPI executor in scope
std::runtime_errorif there's an SPI error

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