|
StormByte C++ Library: Database module 0.0.9999
StormByte-Database is a StormByte library module for handling database connections
|
PostgreSQL database implementation. More...
#include <postgres.hxx>


Public Member Functions | |
| Postgres (const Postgres &db)=delete | |
| Postgres (Postgres &&db) noexcept=default | |
| Postgres & | operator= (const Postgres &db)=delete |
| Postgres & | operator= (Postgres &&db) noexcept=default |
| virtual | ~Postgres () noexcept |
| ExpectedRows | Query (const std::string &query) noexcept override |
| bool | SilentQuery (const std::string &query) noexcept override |
Public Member Functions inherited from StormByte::Database::Database | |
| Database (std::shared_ptr< Logger::Log > logger) noexcept | |
| Default constructor. | |
| Database (const Database &other)=delete | |
| Default copy constructor (deleted) | |
| Database (Database &&other)=default | |
| Default move constructor. | |
| Database & | operator= (const Database &other)=delete |
| Default copy assignment operator (deleted) | |
| Database & | operator= (Database &&other)=default |
| Default move assignment operator. | |
| virtual | ~Database ()=default |
| Default destructor. | |
| bool | Connect () noexcept |
| Connects to the database. | |
| virtual void | Disconnect () noexcept |
| Disconnects from the database. | |
| bool | IsConnected () const noexcept |
| Checks if the database is connected. | |
| template<typename... Args> | |
| ExpectedRows | ExecuteSTMT (const std::string &name, Args &&... args) |
| virtual void | BeginTransaction () |
| virtual void | BeginExclusiveTransaction () |
| virtual void | CommitTransaction () |
| virtual void | RollbackTransaction () |
Protected Member Functions | |
| Postgres (const std::string &host, const std::string &user, const std::string &password, const std::string &db_name, std::shared_ptr< Logger::Log > logger) | |
| Postgres (std::string &&host, std::string &&user, std::string &&password, std::string &&db_name, std::shared_ptr< Logger::Log > logger) | |
Protected Member Functions inherited from StormByte::Database::Database | |
| virtual void | DoPreConnect () noexcept |
| Pre-connect action Default is a noop. | |
| virtual void | DoPostConnect () noexcept |
| Post-connect action Default is a noop. | |
| virtual void | DoPostDisconnect () noexcept |
| Post-disconnect action Default is a noop. | |
| void | PrepareSTMT (std::string &&name, std::string &&query) noexcept |
Additional Inherited Members | |
Protected Attributes inherited from StormByte::Database::Database | |
| std::shared_ptr< Logger::Log > | m_logger |
| Logger instance. | |
| std::unordered_map< std::string, std::unique_ptr< PreparedSTMT > > | m_prepared_stmts |
| Prepared statements. | |
| bool | m_connected |
| Connection state. | |
PostgreSQL database implementation.
|
delete |
Default copy constructor (deleted)
| db | Other Postgres database to copy from |
|
defaultnoexcept |
Default move constructor
| db | Other Postgres database to move from |
|
virtualnoexcept |
Destructor
|
protected |
Constructor
| host | The database host |
| user | The database user |
| password | The database password |
| db_name | The database name |
| logger | Logger instance |
|
protected |
Constructor moving strings
| host | The database host |
| user | The database user |
| password | The database password |
| db_name | The database name |
| logger | Logger instance |
|
overridevirtualnoexcept |
Executes a query on the database
| query | The query to execute |
Implements StormByte::Database::Database.
|
overridevirtualnoexcept |
Executes a query on the database without returning results
| query | The query to execute |
Implements StormByte::Database::Database.