6#if !defined(PQXX_H_STREAM_QUERY_IMPL)
7# define PQXX_H_STREAM_QUERY_IMPL
11template<
typename... TYPE>
13 transaction_base &tx, std::string_view query) :
17 r.expect_columns(
sizeof...(TYPE));
23template<
typename... TYPE>
25stream_query<TYPE...>::get_finder(transaction_base
const &tx)
27 auto const group{
enc_group(tx.conn().encoding_id())};
75 return m_home->parse_line(
zview{m_line.get(), m_line_size});
91 m_line = std::move(rhs.m_line);
93 m_line_size = rhs.m_line_size;
102 bool done() const noexcept {
return m_home->
done(); }
108 void consume_line() &
111 m_line = std::move(line);
118 char *
const ptr{m_line.get()};
119 assert(ptr[size] ==
'\n');
130 std::size_t m_line_size;
134template<
typename... TYPE>
142template<
typename... TYPE>
156template<
typename... TYPE>
157inline std::pair<
typename stream_query<TYPE...>::line_handle, std::size_t>
162 internal::gate::connection_stream_from
gate{
m_trans->conn()};
165 auto line{
gate.read_copy_line()};
171 catch (std::exception
const &)
Stream query results from the database. Used by transaction_base::stream.
Definition stream_query.hxx:80
bool done() const &noexcept
Has this stream reached the end of its data?
Definition stream_query.hxx:106
std::unique_ptr< char, void(*)(void const *)> line_handle
Definition stream_query.hxx:82
stream_query(transaction_base &tx, std::string_view query)
Execute query on tx, stream results.
Definition stream_query_impl.hxx:12
auto begin() &
Begin iterator. Only for use by "range for.".
Definition stream_query_impl.hxx:150
std::pair< line_handle, std::size_t > read_line() &
Read a COPY line from the server.
Definition stream_query_impl.hxx:158
void register_me()
Definition transaction_base.cxx:515
transaction_focus(transaction_base &t, std::string_view cname, std::string_view oname)
Definition transaction_focus.hxx:31
transaction_base * m_trans
Definition transaction_focus.hxx:95
Marker-type wrapper: zero-terminated std::string_view.
Definition zview.hxx:38
Definition connection.hxx:108
Forward declarations of libpq types as needed in libpqxx headers.
Definition util.cxx:204
Internal items for libpqxx' own use. Do not use these yourself.
Definition encodings.cxx:33
std::string concat(TYPE... item)
Efficiently combine a bunch of items into one big string.
Definition concat.hxx:31
bool operator!=(stream_query_end_iterator, stream_query_input_iterator< TYPE... > const &i)
Definition stream_query_impl.hxx:143
PQXX_PURE constexpr char_finder_func * get_s_char_finder(encoding_group enc)
Look up a "sentry" character search function for an encoding group.
Definition encodings.hxx:849
pqxx::internal::encoding_group enc_group(std::string_view encoding_name)
Convert libpq encoding name to its libpqxx encoding group.
Definition encodings.cxx:35
std::size_t(std::string_view haystack, std::size_t start) char_finder_func
Function type: "find first occurrence of specific any of ASCII characters.".
Definition encoding_group.hxx:70
bool operator==(stream_query_end_iterator, stream_query_input_iterator< TYPE... > const &i)
Definition stream_query_impl.hxx:135
The end() iterator for a stream_query.
Definition stream_query.hxx:47
The home of all libpqxx classes, functions, templates, etc.
Definition array.cxx:27