16 #include "pqxx/compiler-public.hxx" 17 #include "pqxx/internal/compiler-internal-pre.hxx" 21 #if defined(PQXX_HAVE_SPAN) && __has_include(<span>) 25 #include "pqxx/dbtransaction.hxx" 57 [[nodiscard]]
static blob open_r(dbtransaction &, oid);
59 [[nodiscard]]
static blob open_w(dbtransaction &, oid);
61 [[nodiscard]]
static blob open_rw(dbtransaction &, oid);
74 blob &operator=(
blob const &) =
delete;
84 static constexpr std::size_t chunk_limit = 0x7fffffff;
95 std::size_t read(std::basic_string<std::byte> &buf, std::size_t size);
97 #if defined(PQXX_HAVE_SPAN) 105 std::span<std::byte> read(std::span<std::byte> buf)
107 return buf.subspan(0, raw_read(buf.data(), std::size(buf)));
125 template<
typename ALLOC>
126 std::basic_string_view<std::byte>
read(std::vector<std::byte, ALLOC> &buf)
128 return std::basic_string_view<std::byte>{
129 buf.data(), raw_read(buf.data(), std::size(buf))};
132 #endif // PQXX_HAVE_SPAN 154 void write(std::basic_string_view<std::byte> data);
163 void resize(std::int64_t size);
166 [[nodiscard]] std::int64_t tell()
const;
169 std::int64_t seek_abs(std::int64_t offset = 0);
171 std::int64_t seek_rel(std::int64_t offset = 0);
173 std::int64_t seek_end(std::int64_t offset = 0);
180 dbtransaction &tx, std::basic_string_view<std::byte> data, oid
id = 0);
185 static void append_from_buf(
186 dbtransaction &tx, std::basic_string_view<std::byte> data, oid
id);
189 static oid from_file(dbtransaction &,
char const path[]);
195 static oid from_file(dbtransaction &,
char const path[], oid);
202 dbtransaction &, oid, std::basic_string<std::byte> &,
203 std::size_t max_size);
212 static std::size_t append_to_buf(
213 dbtransaction &tx, oid
id, std::int64_t offset,
214 std::basic_string<std::byte> &buf, std::size_t append_max);
217 static void to_file(dbtransaction &, oid,
char const path[]);
231 m_conn{&conn}, m_fd{fd}
233 static PQXX_PRIVATE
blob open_internal(dbtransaction &, oid,
int);
234 static PQXX_PRIVATE pqxx::internal::pq::PGconn *
236 static PQXX_PRIVATE pqxx::internal::pq::PGconn *
238 static PQXX_PRIVATE std::string errmsg(
connection const *);
239 static PQXX_PRIVATE std::string errmsg(dbtransaction
const &tx)
241 return errmsg(&tx.
conn());
243 PQXX_PRIVATE std::string errmsg()
const {
return errmsg(m_conn); }
244 PQXX_PRIVATE std::int64_t seek(std::int64_t offset,
int whence);
245 std::size_t raw_read(std::byte buf[], std::size_t size);
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:25
connection & conn() const
The connection in which this transaction lives.
Definition: transaction_base.hxx:495
Connection to a database.
Definition: connection.hxx:183
std::basic_string_view< std::byte > read(std::vector< std::byte, ALLOC > &buf)
Read up to std::size(buf) bytes from the object.
Definition: blob.hxx:126
std::vector< std::string_view > to_buf(char *here, char const *end, TYPE... value)
Convert multiple values to strings inside a single buffer.
Definition: strconv.hxx:332
Abstract transaction base class: bracket transactions on the database.
Definition: dbtransaction.hxx:52