#include <userver/storages/postgres/options.hpp>
A structure to control timeouts for PosrgreSQL queries
There are two parameters, execute
and statement
.
execute
parameter controls the overall time the driver spends executing a query, that includes:
statement
is rather straightforward, it's the PostgreSQL server-side parameter, and it controls the time the database backend can spend executing a single statement. It is very costly to change the statement timeout often, as it requires a roundtrip to the database to change the setting.
execute
timeout should always be greater than the statement
timeout!
In case of a timeout, either back-end or overall, the client gets an exception and the driver tries to clean up the connection for further reuse.
Definition at line 107 of file options.hpp.
Public Member Functions | |
constexpr | CommandControl (TimeoutDuration execute, TimeoutDuration statement) |
constexpr CommandControl | WithExecuteTimeout (TimeoutDuration n) const noexcept |
constexpr CommandControl | WithStatementTimeout (TimeoutDuration s) const noexcept |
bool | operator== (const CommandControl &rhs) const |
bool | operator!= (const CommandControl &rhs) const |
Public Attributes | |
TimeoutDuration | execute {} |
Overall timeout for a command being executed. | |
TimeoutDuration | statement {} |
PostgreSQL server-side timeout. | |
|
inlineconstexpr |
Definition at line 113 of file options.hpp.
|
inline |
Definition at line 122 of file options.hpp.
|
inline |
Definition at line 120 of file options.hpp.
|
inlineconstexprnoexcept |
Definition at line 116 of file options.hpp.
|
inlineconstexprnoexcept |
Definition at line 118 of file options.hpp.
TimeoutDuration storages::postgres::CommandControl::execute {} |
Overall timeout for a command being executed.
Definition at line 109 of file options.hpp.
TimeoutDuration storages::postgres::CommandControl::statement {} |
PostgreSQL server-side timeout.
Definition at line 111 of file options.hpp.