Created Pgsql::Transaction class for handling of transactions. It auto rollsback if no commit has been done.
Also moved some code out of the connection files to their own files.
This commit is contained in:
parent
255b2ec970
commit
e32c82ac6f
12 changed files with 394 additions and 130 deletions
|
|
@ -2,33 +2,10 @@
|
|||
#define PGSQL_RESULT_H
|
||||
|
||||
#include "Pgsql_Row.h"
|
||||
#include "Pgsql_ErrorDetails.h"
|
||||
|
||||
namespace Pgsql {
|
||||
|
||||
class ErrorDetails {
|
||||
public:
|
||||
static ErrorDetails createErrorDetailsFromPGresult(const PGresult *res);
|
||||
|
||||
std::string errorMessage;
|
||||
std::string state; ///< PG_DIAG_SQLSTATE Error code as listed in https://www.postgresql.org/docs/9.5/static/errcodes-appendix.html
|
||||
std::string severity;
|
||||
std::string messagePrimary;
|
||||
std::string messageDetail;
|
||||
std::string messageHint;
|
||||
int statementPosition; ///< First character is one, measured in characters not bytes!
|
||||
int internalPosition;
|
||||
std::string internalQuery;
|
||||
std::string context;
|
||||
std::string schemaName;
|
||||
std::string tableName;
|
||||
std::string columnName;
|
||||
std::string datatypeName;
|
||||
std::string constraintName;
|
||||
std::string sourceFile;
|
||||
std::string sourceLine;
|
||||
std::string sourceFunction;
|
||||
};
|
||||
|
||||
/** \brief Non-copyable but movable wrapper for a postgresql result.
|
||||
*
|
||||
* This class makes sure the result is removed from memory. It also supplies an iterator for the
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue