Loading...
Searching...
No Matches
nontransaction.hxx
/* Definition of the pqxx::nontransaction class.
*
* pqxx::nontransaction provides nontransactional database access
*
* DO NOT INCLUDE THIS FILE DIRECTLY; include pqxx/nontransaction instead.
*
* Copyright (c) 2000-2024, Jeroen T. Vermeulen.
*
* See COPYING for copyright license. If you did not receive a file called
* COPYING with this source code, please notify the distributor of this
* mistake, or contact the author.
*/
#ifndef PQXX_H_NONTRANSACTION
#define PQXX_H_NONTRANSACTION
#if !defined(PQXX_HEADER_PRE)
# error "Include libpqxx headers as <pqxx/header>, not <pqxx/header.hxx>."
#endif
#include "pqxx/connection.hxx"
#include "pqxx/result.hxx"
#include "pqxx/transaction.hxx"
namespace pqxx
{
using namespace std::literals;
class PQXX_LIBEXPORT nontransaction final : public transaction_base
{
public:
nontransaction(connection &cx, std::string_view tname = ""sv) :
transaction_base{cx, tname, std::shared_ptr<std::string>{}}
{
register_transaction();
}
virtual ~nontransaction() override { close(); }
private:
virtual void do_commit() override {}
};
} // namespace pqxx
#endif
pqxx::connection
Connection to a database.
Definition connection.hxx:279
pqxx::nontransaction::nontransaction
nontransaction(connection &cx, std::string_view tname=""sv)
Constructor.
Definition nontransaction.hxx:69
pqxx::nontransaction
Simple "transaction" class offering no transactional integrity.
Definition nontransaction.hxx:61
pqxx::transaction_base
Interface definition (and common code) for "transaction" classes.
Definition transaction_base.hxx:151
pqxx
The home of all libpqxx classes, functions, templates, etc.
Definition array.cxx:27