|
libpqxx
The C++ client library for PostgreSQL
|
Cursor with SQL positioning semantics. More...
#include <sql_cursor.hxx>
Inheritance diagram for pqxx::internal::sql_cursor:
Collaboration diagram for pqxx::internal::sql_cursor:Public Member Functions | |
| sql_cursor (transaction_base &t, std::string_view query, std::string_view cname, cursor_base::access_policy ap, cursor_base::update_policy up, cursor_base::ownership_policy op, bool hold, sl=sl::current()) | |
| sql_cursor (transaction_base &t, std::string_view cname, cursor_base::ownership_policy op, sl=sl::current()) | |
| sql_cursor (sql_cursor const &)=delete | |
| sql_cursor (sql_cursor &&)=delete | |
| ~sql_cursor () noexcept | |
| sql_cursor & | operator= (sql_cursor const &)=delete |
| sql_cursor & | operator= (sql_cursor &&)=delete |
| result | fetch (difference_type rows, difference_type &displacement, sl) |
| PQXX_INLINE_COV result | fetch (difference_type rows, sl loc) |
| difference_type | move (difference_type rows, difference_type &displacement, sl) |
| PQXX_INLINE_COV difference_type | move (difference_type rows, sl loc) |
| PQXX_INLINE_COV difference_type | pos () const noexcept |
| Current position, or -1 for unknown. More... | |
| PQXX_INLINE_COV difference_type | endpos () const noexcept |
| End position, or -1 for unknown. More... | |
| PQXX_INLINE_COV result const & | empty_result () const noexcept |
| Return zero-row result for this cursor. More... | |
| void | close (sl loc) |
| constexpr PQXX_PURE sl | created_loc () const noexcept |
Public Member Functions inherited from pqxx::cursor_base | |
| cursor_base ()=delete | |
| cursor_base (cursor_base const &)=delete | |
| cursor_base (cursor_base &&)=delete | |
| ~cursor_base ()=default | |
| cursor_base & | operator= (cursor_base const &)=delete |
| cursor_base & | operator= (cursor_base &&)=delete |
| constexpr std::string const & | name () const noexcept |
| Name of underlying SQL cursor. More... | |
Additional Inherited Members | |
Public Types inherited from pqxx::cursor_base | |
| enum | access_policy { forward_only , random_access } |
| Cursor access-pattern policy. More... | |
| enum | update_policy { read_only , update } |
| Cursor update policy. More... | |
| enum | ownership_policy { owned , loose } |
| Cursor destruction policy. More... | |
| using | size_type = result_size_type |
| using | difference_type = result_difference_type |
Static Public Member Functions inherited from pqxx::cursor_base | |
| static constexpr difference_type | all () noexcept |
| Special value: read until end. More... | |
| static constexpr difference_type | next () noexcept |
| Special value: read one row only. More... | |
| static constexpr difference_type | prior () noexcept |
| Special value: read backwards, one row only. More... | |
| static constexpr difference_type | backward_all () noexcept |
| Special value: read backwards from current position back to origin. More... | |
Protected Member Functions inherited from pqxx::cursor_base | |
| cursor_base (connection &, std::string_view Name, bool embellish_name=true, sl loc=sl::current()) | |
| sl | created_loc () const |
The std::source_location for where this cursor was created. More... | |
Protected Attributes inherited from pqxx::cursor_base | |
| std::string const | m_name |
| sl | m_created_loc |
The std::source_location for where this cursor was created. More... | |
Cursor with SQL positioning semantics.
Thin wrapper around an SQL cursor, with SQL's ideas of positioning.
SQL cursors have pre-increment/pre-decrement semantics, with on either end of the result set a special position that does not repesent a row. This class models SQL cursors for the purpose of implementing more C++-like semantics on top.
Positions of actual rows are numbered starting at 1. Position 0 exists but does not refer to a row. There is a similar non-row position at the end of the result set.
Don't use this at home. You deserve better. Use the stateless_cursor instead.
| pqxx::internal::sql_cursor::sql_cursor | ( | transaction_base & | t, |
| std::string_view | query, | ||
| std::string_view | cname, | ||
| cursor_base::access_policy | ap, | ||
| cursor_base::update_policy | up, | ||
| cursor_base::ownership_policy | op, | ||
| bool | hold, | ||
| sl | loc = sl::current() |
||
| ) |
| pqxx::internal::sql_cursor::sql_cursor | ( | transaction_base & | t, |
| std::string_view | cname, | ||
| cursor_base::ownership_policy | op, | ||
| sl | loc = sl::current() |
||
| ) |
|
delete |
|
delete |
|
noexcept |
| void pqxx::internal::sql_cursor::close | ( | sl | loc | ) |
|
inlinenoexcept |
Return zero-row result for this cursor.
|
inlinenoexcept |
End position, or -1 for unknown.
Returns the final position, just after the last row in the result set. The starting position, just before the first row, counts as position zero.
End position is unknown until it is encountered during use.
| pqxx::result pqxx::internal::sql_cursor::fetch | ( | difference_type | rows, |
| difference_type & | displacement, | ||
| sl | loc | ||
| ) |
|
inline |
| pqxx::cursor_base::difference_type pqxx::internal::sql_cursor::move | ( | difference_type | rows, |
| difference_type & | displacement, | ||
| sl | loc | ||
| ) |
|
inline |
|
delete |
|
delete |
|
inlinenoexcept |
Current position, or -1 for unknown.
The starting position, just before the first row, counts as position zero.
Position may be unknown if (and only if) this cursor was adopted, and has never hit its starting position (position zero).