6 #ifndef IROHA_POSTGRES_SPECIFIC_QUERY_EXECUTOR_HPP 7 #define IROHA_POSTGRES_SPECIFIC_QUERY_EXECUTOR_HPP 11 #include <soci/soci.h> 18 class PermissionToString;
22 class GetAccountTransactions;
23 class GetAccountAssetTransactions;
24 class GetTransactions;
25 class GetAccountAssets;
26 class GetAccountDetail;
28 class GetRolePermissions;
30 class GetPendingTransactions;
32 class GetEngineReceipts;
38 class PendingTransactionStorage;
56 std::shared_ptr<PendingTransactionStorage> pending_txs_storage,
57 std::shared_ptr<shared_model::interface::QueryResponseFactory>
59 std::shared_ptr<shared_model::interface::PermissionToString>
66 bool hasAccountRolePermission(
68 const std::string &account_id)
const override;
145 template <
typename RangeGen,
typename Pred,
typename OutputIterator>
148 RangeGen &&range_gen,
150 OutputIterator dest_it);
167 template <
typename QueryTuple,
168 typename PermissionTuple,
170 typename ResponseCreator,
171 typename PermissionsErrResponse>
173 QueryExecutor &&query_executor,
175 ResponseCreator &&response_creator,
176 PermissionsErrResponse &&perms_err_response);
186 std::unique_ptr<shared_model::interface::QueryResponse>
187 logAndReturnErrorResponse(
208 template <
typename Query,
209 typename QueryChecker,
210 typename QueryApplier,
211 typename... Permissions>
216 QueryChecker &&qry_checker,
217 char const *related_txs,
218 QueryApplier applier,
219 Permissions... perms);
236 template <
typename ReturnValueType>
237 bool existsInDb(
const std::string &table_name,
238 const std::string &key_name,
239 const std::string &value_name,
240 const std::string &value)
const;
242 struct QueryFallbackCheckResult {
243 QueryFallbackCheckResult() =
default;
244 QueryFallbackCheckResult(
249 : contains_error{
true},
250 error_code{error_code},
251 error_message{std::move(error_message)} {}
253 explicit operator bool()
const {
254 return contains_error;
256 bool contains_error =
false;
265 std::shared_ptr<PendingTransactionStorage> pending_txs_storage_;
266 std::shared_ptr<shared_model::interface::QueryResponseFactory>
267 query_response_factory_;
268 std::shared_ptr<shared_model::interface::PermissionToString>
271 std::string ordering_str_;
277 #endif // IROHA_POSTGRES_SPECIFIC_QUERY_EXECUTOR_HPP Definition: get_pending_transactions.hpp:21
Definition: get_asset_info.hpp:17
Definition: error_query_response.hpp:30
Definition: get_transactions.hpp:14
std::string ErrorMessageType
Message type.
Definition: error_query_response.hpp:54
Definition: block_storage.hpp:23
shared_model::interface::ErrorQueryResponse ErrorQueryResponse
Definition: postgres_specific_query_executor.hpp:47
ErrorQueryResponse::ErrorCodeType QueryErrorCodeType
Definition: postgres_specific_query_executor.hpp:49
Definition: specific_query_executor.hpp:30
Definition: result_fwd.hpp:27
Definition: get_account_asset_transactions.hpp:21
std::shared_ptr< Logger > LoggerPtr
Definition: logger_fwd.hpp:22
Role
Definition: permissions.hpp:17
Definition: postgres_specific_query_executor.hpp:51
shared_model::interface::QueryResponseFactory::ErrorQueryType QueryErrorType
Definition: postgres_specific_query_executor.hpp:45
std::unique_ptr< shared_model::interface::QueryResponse > QueryExecutorResult
Definition: query_executor.hpp:23
Definition: get_signatories.hpp:18
Definition: get_account_transactions.hpp:21
Definition: block_query.hpp:15
std::string AccountIdType
Type of account id.
Definition: types.hpp:38
Definition: query_executor.hpp:25
Definition: get_roles.hpp:17
Definition: get_peers.hpp:17
Definition: get_account_detail.hpp:29
Definition: get_account.hpp:14
WsvCommandResult execute(soci::statement &st, Function &&error)
Definition: postgres_wsv_command.cpp:26
Definition: get_engine_receipts.hpp:17
ErrorQueryType
Definition: query_response_factory.hpp:110
uint32_t ErrorCodeType
Error code type.
Definition: error_query_response.hpp:62
Definition: get_block.hpp:14
ErrorQueryResponse::ErrorMessageType QueryErrorMessageType
Definition: postgres_specific_query_executor.hpp:48
Definition: get_role_permissions.hpp:18
Definition: command_executor.hpp:12
Definition: get_account_assets.hpp:20