libpqxx
The C++ client library for PostgreSQL
Loading...
Searching...
No Matches
nontransaction.hxx
1/* Definition of the pqxx::nontransaction class.
2 *
3 * pqxx::nontransaction provides nontransactional database access
4 *
5 * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/nontransaction instead.
6 *
7 * Copyright (c) 2000-2025, Jeroen T. Vermeulen.
8 *
9 * See COPYING for copyright license. If you did not receive a file called
10 * COPYING with this source code, please notify the distributor of this
11 * mistake, or contact the author.
12 */
13#ifndef PQXX_H_NONTRANSACTION
14#define PQXX_H_NONTRANSACTION
15
16#if !defined(PQXX_HEADER_PRE)
17# error "Include libpqxx headers as <pqxx/header>, not <pqxx/header.hxx>."
18#endif
19
20#include "pqxx/connection.hxx"
21#include "pqxx/result.hxx"
22#include "pqxx/transaction.hxx"
23
24namespace pqxx
25{
26using namespace std::literals;
27
29
60class PQXX_LIBEXPORT nontransaction final : public transaction_base
61{
62public:
64
69 nontransaction(connection &cx, std::string_view tname = ""sv) :
70 transaction_base{cx, tname, std::shared_ptr<std::string>{}}
71 {
72 register_transaction();
73 }
74
75 virtual ~nontransaction() override { close(); }
76
77private:
78 virtual void do_commit() override {}
79};
80} // namespace pqxx
81#endif
The home of all libpqxx classes, functions, templates, etc.
Definition array.cxx:27
constexpr char array_separator
Element separator between SQL array elements of this type.
Definition strconv.hxx:559