|
relx 0.1.0
A Modern C++23 Type-Safe SQL Query Builder
|
PostgreSQL streaming data source for processing large result sets. More...
#include <relx/connection/postgresql_streaming_source.hpp>
Public Member Functions | |
| PostgreSQLStreamingSource (PostgreSQLConnection &connection, std::string sql, std::vector< std::string > params={}) | |
| Constructor with connection and query parameters. | |
| PostgreSQLStreamingSource (PostgreSQLConnection &connection, std::string sql, std::vector< std::string > params, std::vector< bool > is_binary) | |
| Constructor with connection and binary query parameters. | |
| ~PostgreSQLStreamingSource () | |
| Destructor that cleans up any active query. | |
| PostgreSQLStreamingSource (const PostgreSQLStreamingSource &)=delete | |
| PostgreSQLStreamingSource & | operator= (const PostgreSQLStreamingSource &)=delete |
| PostgreSQLStreamingSource (PostgreSQLStreamingSource &&other) noexcept | |
| PostgreSQLStreamingSource & | operator= (PostgreSQLStreamingSource &&other) noexcept |
| ConnectionResult< void > | initialize () |
| Initialize the streaming query. | |
| std::optional< std::string > | get_next_row () |
| Get the next row from the result set. | |
| const std::vector< std::string > & | get_column_names () const |
| Get the column names for the result set. | |
| bool | is_initialized () const |
| Check if the streaming source has been initialized. | |
| bool | has_more_rows () const |
| Check if there are more rows available. | |
PostgreSQL streaming data source for processing large result sets.
This class implements the data source interface required by StreamingResultSet. It uses PostgreSQL's single-row mode to fetch results incrementally, which is ideal for processing large datasets without loading everything into memory.
Definition at line 21 of file postgresql_streaming_source.hpp.
| relx::connection::PostgreSQLStreamingSource::PostgreSQLStreamingSource | ( | PostgreSQLConnection & | connection, |
| std::string | sql, | ||
| std::vector< std::string > | params = {} |
||
| ) |
Constructor with connection and query parameters.
| connection | PostgreSQL connection to use for queries |
| sql | The SQL query string to execute |
| params | Optional query parameters |
| relx::connection::PostgreSQLStreamingSource::PostgreSQLStreamingSource | ( | PostgreSQLConnection & | connection, |
| std::string | sql, | ||
| std::vector< std::string > | params, | ||
| std::vector< bool > | is_binary | ||
| ) |
Constructor with connection and binary query parameters.
| connection | PostgreSQL connection to use for queries |
| sql | The SQL query string to execute |
| params | Query parameters |
| is_binary | Vector indicating which parameters are binary |
| relx::connection::PostgreSQLStreamingSource::~PostgreSQLStreamingSource | ( | ) |
Destructor that cleans up any active query.
|
delete |
|
noexcept |
| const std::vector< std::string > & relx::connection::PostgreSQLStreamingSource::get_column_names | ( | ) | const |
Get the column names for the result set.
| std::optional< std::string > relx::connection::PostgreSQLStreamingSource::get_next_row | ( | ) |
Get the next row from the result set.
Returns row data in the format "col1|col2|col3|..." for compatibility with LazyRow
|
inline |
Check if there are more rows available.
Definition at line 68 of file postgresql_streaming_source.hpp.
| ConnectionResult< void > relx::connection::PostgreSQLStreamingSource::initialize | ( | ) |
Initialize the streaming query.
|
inline |
Check if the streaming source has been initialized.
Definition at line 64 of file postgresql_streaming_source.hpp.
|
delete |
|
noexcept |