16 #if !defined(PQXX_HEADER_PRE)
17 # error "Include libpqxx headers as <pqxx/header>, not <pqxx/header.hxx>."
110 return (std::numeric_limits<int>::max)() - 1;
131 return (std::numeric_limits<int>::min)() + 1;
142 [[nodiscard]] constexpr std::string
const &
name() const noexcept
167 template<cursor_base::update_policy up, cursor_base::ownership_policy op>
197 m_cur{tx, adopted_cursor, op}
239 [[nodiscard]] constexpr std::string
const &
name() const noexcept
249 class icursor_iterator;
255 class icursor_iterator_icursorstream;
256 class icursorstream_icursor_iterator;
330 constexpr
operator bool() const & noexcept {
return not m_done; }
370 void set_stride(difference_type stride) &;
386 internal::sql_cursor m_cur;
388 difference_type m_stride;
389 difference_type m_realpos, m_reqpos;
435 icursor_iterator() noexcept;
437 icursor_iterator(icursor_iterator const &) noexcept;
438 ~icursor_iterator() noexcept;
450 icursor_iterator &operator++();
451 icursor_iterator operator++(
int) &;
452 icursor_iterator &operator+=(difference_type);
453 icursor_iterator &operator=(icursor_iterator
const &) noexcept;
455 [[nodiscard]]
bool operator==(icursor_iterator const &rhs) const;
456 [[nodiscard]]
bool operator!=(icursor_iterator const &rhs) const noexcept
460 [[nodiscard]]
bool operator<(icursor_iterator
const &rhs)
const;
461 [[nodiscard]]
bool operator>(icursor_iterator
const &rhs)
const
465 [[nodiscard]]
bool operator<=(icursor_iterator
const &rhs)
const
467 return not(*
this > rhs);
469 [[nodiscard]]
bool operator>=(icursor_iterator
const &rhs)
const
471 return not(*
this < rhs);
475 void refresh()
const;
478 difference_type pos() const noexcept {
return m_pos; }
479 void fill(
result const &);
483 difference_type m_pos;
484 icursor_iterator *m_prev{
nullptr}, *m_next{
nullptr};
Cursor can move forward only.
Definition: cursor.hxx:54
result_size_type size_type
Definition: cursor.hxx:44
constexpr std::string const & name() const noexcept
Return this cursor's name.
Definition: cursor.hxx:239
Common definitions for cursor types.
Definition: cursor.hxx:41
bool operator>(icursor_iterator const &rhs) const
Definition: cursor.hxx:461
static constexpr difference_type next() noexcept
Special value: read one row only.
Definition: cursor.hxx:116
result_size_type size_type
Definition: cursor.hxx:171
bool operator==(stream_query_end_iterator, stream_query_input_iterator< TYPE... > const &i)
Definition: stream_query_impl.hxx:135
result const * pointer
Definition: cursor.hxx:429
result_difference_type difference_type
Definition: cursor.hxx:172
size_type size()
Number of rows in cursor's result set.
Definition: cursor.hxx:215
Definition: icursor_iterator-icursorstream.hxx:5
static constexpr difference_type backward_all() noexcept
Special value: read backwards from current position back to origin.
Definition: cursor.hxx:129
cursor_base::size_type size_type
Definition: cursor.hxx:281
result retrieve(difference_type begin_pos, difference_type end_pos)
Retrieve rows from begin_pos (inclusive) to end_pos (exclusive)
Definition: cursor.hxx:232
result const * operator->() const
Definition: cursor.hxx:445
constexpr std::string const & name() const noexcept
Name of underlying SQL cursor.
Definition: cursor.hxx:142
stateless_cursor(transaction_base &tx, std::string_view adopted_cursor)
Adopt an existing scrolling SQL cursor.
Definition: cursor.hxx:196
Cursor can move back and forth.
Definition: cursor.hxx:56
bool operator<=(icursor_iterator const &rhs) const
Definition: cursor.hxx:465
static constexpr difference_type prior() noexcept
Special value: read backwards, one row only.
Definition: cursor.hxx:121
PQXX_LIBEXPORT result stateless_cursor_retrieve(sql_cursor &, result::difference_type size, result::difference_type begin_pos, result::difference_type end_pos)
Definition: cursor.cxx:42
Simple read-only cursor represented as a stream of results.
Definition: cursor.hxx:278
Result set containing data returned by a query or command.
Definition: result.hxx:91
int result_size_type
Number of rows in a result set.
Definition: types.hxx:40
Definition: connection.hxx:106
difference_type move(difference_type rows, difference_type &displacement)
Definition: sql_cursor.cxx:236
PQXX_LIBEXPORT result_size_type obtain_stateless_cursor_size(sql_cursor &)
Definition: cursor.cxx:34
constexpr difference_type stride() const noexcept
Definition: cursor.hxx:371
static constexpr difference_type all() noexcept
Special value: read until end.
Definition: cursor.hxx:108
istream_type::size_type size_type
Definition: cursor.hxx:432
std::string const m_name
Definition: cursor.hxx:150
Cursor can be used to read data but not to write.
Definition: cursor.hxx:66
int result_difference_type
Difference between result sizes.
Definition: types.hxx:43
void close() noexcept
Close this cursor.
Definition: cursor.hxx:209
cursor_base::difference_type difference_type
Definition: cursor.hxx:282
Cursor with SQL positioning semantics.
Definition: sql_cursor.hxx:31
The home of all libpqxx classes, functions, templates, etc.
Definition: array.cxx:26
Reference to a field in a result set.
Definition: field.hxx:34
result_difference_type difference_type
Definition: result.hxx:95
bool operator>=(icursor_iterator const &rhs) const
Definition: cursor.hxx:469
stateless_cursor(transaction_base &tx, std::string_view query, std::string_view cname, bool hold)
Create cursor.
Definition: cursor.hxx:183
std::input_iterator_tag iterator_category
Definition: cursor.hxx:427
"Stateless cursor" class: easy API for retrieving parts of result sets
Definition: cursor.hxx:168
Destroy SQL cursor when cursor object is closed at end of transaction.
Definition: cursor.hxx:90
Approximate istream_iterator for icursorstream.
Definition: cursor.hxx:424
Definition: icursorstream-icursor_iterator.hxx:5
Connection to a database.
Definition: connection.hxx:278
access_policy
Cursor access-pattern policy.
Definition: cursor.hxx:51
result const & reference
Definition: cursor.hxx:430
result_difference_type difference_type
Definition: cursor.hxx:45
update_policy
Cursor update policy.
Definition: cursor.hxx:63
icursorstream & operator>>(result &res)
Read new value into given result object; same as get(result&).
Definition: cursor.hxx:355
ownership_policy
Cursor destruction policy.
Definition: cursor.hxx:87
void close() noexcept
Definition: sql_cursor.cxx:139
Interface definition (and common code) for "transaction" classes.
Definition: transaction_base.hxx:150