hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::ametsuchi::PgConnectionInit Class Reference

#include "pg_connection_init.hpp"

Collaboration diagram for iroha::ametsuchi::PgConnectionInit:
Collaboration graph

Public Member Functions

template<typename RollbackFunction >
iroha::expected::Result< void, std::string > initializeConnectionPool (soci::connection_pool &connection_pool, size_t pool_size, RollbackFunction try_rollback, FailoverCallbackHolder &callback_factory, const ReconnectionStrategyFactory &reconnection_strategy_factory, const std::string &pg_reconnection_options, logger::LoggerManagerTreePtr log_manager)
 

Static Public Member Functions

static expected::Result< void, std::string > prepareWorkingDatabase (StartupWsvDataPolicy startup_wsv_data_policy, const PostgresOptions &options)
 
static expected::Result< std::shared_ptr< PoolWrapper >, std::string > prepareConnectionPool (const ReconnectionStrategyFactory &reconnection_strategy_factory, const PostgresOptions &options, const int pool_size, logger::LoggerManagerTreePtr log_manager)
 
static bool preparedTransactionsAvailable (soci::session &sql)
 
static iroha::expected::Result< void, std::string > rollbackPrepared (soci::session &sql, const std::string &prepared_block_name)
 
static expected::Result< void, std::string > dropWorkingDatabase (const PostgresOptions &options)
 
static expected::Result< void, std::string > resetPeers (soci::session &sql)
 
static void prepareTables (soci::session &session)
 Create tables in the given session. Left public for tests. More...
 
static expected::Result< void, std::string > createSchema (const PostgresOptions &postgres_options)
 

Member Function Documentation

◆ createSchema()

iroha::expected::Result< void, std::string > PgConnectionInit::createSchema ( const PostgresOptions postgres_options)
static

Creates schema. Working database must not exist when calling this.

Returns
void value in case of success or an error message otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dropWorkingDatabase()

iroha::expected::Result< void, std::string > PgConnectionInit::dropWorkingDatabase ( const PostgresOptions options)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initializeConnectionPool()

template<typename RollbackFunction >
iroha::expected::Result<void, std::string> iroha::ametsuchi::PgConnectionInit::initializeConnectionPool ( soci::connection_pool &  connection_pool,
size_t  pool_size,
RollbackFunction  try_rollback,
FailoverCallbackHolder callback_factory,
const ReconnectionStrategyFactory reconnection_strategy_factory,
const std::string &  pg_reconnection_options,
logger::LoggerManagerTreePtr  log_manager 
)

lambda contains special actions which should be execute once

lambda contains actions which should be invoked once for each session

Here is the call graph for this function:

◆ prepareConnectionPool()

iroha::expected::Result< std::shared_ptr< PoolWrapper >, std::string > PgConnectionInit::prepareConnectionPool ( const ReconnectionStrategyFactory reconnection_strategy_factory,
const PostgresOptions options,
const int  pool_size,
logger::LoggerManagerTreePtr  log_manager 
)
static
Here is the call graph for this function:

◆ preparedTransactionsAvailable()

bool PgConnectionInit::preparedTransactionsAvailable ( soci::session &  sql)
static

Verify whether postgres supports prepared transactions

Here is the caller graph for this function:

◆ prepareTables()

void PgConnectionInit::prepareTables ( soci::session &  session)
static

Create tables in the given session. Left public for tests.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepareWorkingDatabase()

iroha::expected::Result< void, std::string > PgConnectionInit::prepareWorkingDatabase ( StartupWsvDataPolicy  startup_wsv_data_policy,
const PostgresOptions options 
)
static
Here is the call graph for this function:

◆ resetPeers()

iroha::expected::Result< void, std::string > PgConnectionInit::resetPeers ( soci::session &  sql)
static

Removes all peers from WSV

Returns
error message if reset has failed
Here is the caller graph for this function:

◆ rollbackPrepared()

iroha::expected::Result< void, std::string > PgConnectionInit::rollbackPrepared ( soci::session &  sql,
const std::string &  prepared_block_name 
)
static
Here is the caller graph for this function:

The documentation for this class was generated from the following files: