libpqxx 7.7.0
subtransaction.hxx
1/* Definition of the pqxx::subtransaction class.
2 *
3 * pqxx::subtransaction is a nested transaction, i.e. one within a transaction.
4 *
5 * DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/subtransaction instead.
6 *
7 * Copyright (c) 2000-2022, 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_SUBTRANSACTION
14#define PQXX_H_SUBTRANSACTION
15
16#include "pqxx/dbtransaction.hxx"
17
18namespace pqxx
19{
24
72class PQXX_LIBEXPORT subtransaction : public transaction_focus,
73 public dbtransaction
74{
75public:
77 explicit subtransaction(dbtransaction &t, std::string_view tname = ""sv);
78
80 explicit subtransaction(subtransaction &t, std::string_view name = ""sv);
81
82 virtual ~subtransaction() noexcept override;
83
84private:
85 std::string quoted_name() const
86 {
87 return quote_name(transaction_focus::name());
88 }
89 virtual void do_commit() override;
90};
91} // namespace pqxx
92#endif
The home of all libpqxx classes, functions, templates, etc.
Definition: array.hxx:23
Abstract transaction base class: bracket transactions on the database.
Definition: dbtransaction.hxx:50
"Transaction" nested within another transaction
Definition: subtransaction.hxx:74
Base class for things that monopolise a transaction's attention.
Definition: transaction_focus.hxx:25
std::string_view name() const &noexcept
Name for this object, if the caller passed one; empty string otherwise.
Definition: transaction_focus.hxx:52