16 #if !defined(PQXX_HEADER_PRE)
17 # error "Include libpqxx headers as <pqxx/header>, not <pqxx/header.hxx>."
51 [[nodiscard]]
static oid
86 static constexpr std::size_t chunk_limit = 0x7fffffff;
97 std::size_t read(
bytes &buf, std::size_t size,
sl = sl::current());
105 template<std::
size_t extent = std::dynamic_extent>
107 read(std::span<std::byte, extent> buf,
sl loc = sl::current())
109 return buf.first(raw_read(std::data(buf), std::size(buf), loc));
118 template<binary DATA>
121 return {std::data(buf), raw_read(std::data(buf), std::size(buf), loc)};
143 template<binary DATA>
void write(DATA
const &data,
sl loc = sl::current())
155 void resize(std::int64_t size,
sl = sl::current());
158 [[nodiscard]] std::int64_t tell(
sl = sl::current())
const;
162 std::int64_t seek_abs(std::int64_t offset = 0,
sl = sl::current());
169 std::int64_t seek_rel(std::int64_t offset = 0,
sl = sl::current());
176 std::int64_t seek_end(std::int64_t offset = 0,
sl = sl::current());
189 template<binary DATA>
199 static void append_from_buf(
205 template<binary DATA>
213 [[nodiscard]]
static oid
236 static std::size_t append_to_buf(
238 std::size_t append_max,
sl = sl::current());
259 static blob open_internal(dbtransaction &,
oid,
int,
sl);
264 PQXX_PRIVATE static std::string errmsg(connection
const *);
265 PQXX_PRIVATE static std::string errmsg(dbtransaction
const &tx)
267 return errmsg(&tx.conn());
271 return errmsg(m_conn);
273 PQXX_PRIVATE std::int64_t seek(std::int64_t offset,
int whence,
sl);
274 std::size_t raw_read(std::byte buf[], std::size_t size,
sl);
277 connection *m_conn =
nullptr;
static oid from_buf(dbtransaction &tx, DATA const &data, oid id=0, sl loc=sl::current())
Create a binary large object containing given data.
Definition: blob.hxx:190
writable_bytes_view read(std::span< std::byte, extent > buf, sl loc=sl::current())
Read up to std::size(buf) bytes from the object.
Definition: blob.hxx:107
blob(blob const &)=delete
blob()=default
You can default-construct a blob, but it won't do anything useful.
blob & operator=(blob const &)=delete
static void append_from_buf(dbtransaction &tx, DATA const &data, oid id, sl loc=sl::current())
Append data to binary large object.
Definition: blob.hxx:206
writable_bytes_view read(DATA &buf, sl loc=sl::current())
Read up to std::size(buf) bytes from the object.
Definition: blob.hxx:119
void write(DATA const &data, sl loc=sl::current())
Write data to large object, at the current position.
Definition: blob.hxx:143
Connection to a database.
Definition: connection.hxx:273
Marker-type wrapper: zero-terminated std::string_view.
Definition: zview.hxx:55
Abstract transaction base class: bracket transactions on the database.
Definition: dbtransaction.hxx:54
void PGconn
Placeholder for libpq's connection type.
Definition: types.hxx:429
The home of all libpqxx classes, functions, templates, etc.
Definition: array.cxx:26
std::string_view to_buf(std::span< char > buf, TYPE const &value, ctx c={})
Represent value as SQL text, optionally using buf as storage.
Definition: strconv.hxx:430
std::span< std::byte const > bytes_view
Type alias for a view of bytes.
Definition: types.hxx:188
std::source_location sl
Convenience alias for std::source_location. It's just too long.
Definition: types.hxx:38
bytes_view binary_cast(TYPE const &data)
Cast binary data to a type that libpqxx will recognise as binary.
Definition: util.hxx:260
std::span< std::byte > writable_bytes_view
Type alias for a view of writable bytes.
Definition: types.hxx:192
unsigned int oid
PostgreSQL database row identifier.
Definition: types.hxx:73
std::vector< std::byte > bytes
Type alias for a container containing bytes.
Definition: util.hxx:240