Definition at line 394 of file coordinator.cpp.
◆ implementation() [1/2]
| arachne::coordination::operational_ledger::implementation::implementation |
( |
const std::filesystem::path & | path | ) |
|
|
inlineexplicit |
Definition at line 395 of file coordinator.cpp.
396 :
database(
nullptr, sqlite3_close) {
397 sqlite3* raw = nullptr;
398 if (sqlite3_open_v2(
399 path.string().c_str(), &raw,
400 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE
401 | SQLITE_OPEN_FULLMUTEX,
402 nullptr
403 )
404 != SQLITE_OK) {
405 const std::string message = raw != nullptr
406 ? sqlite3_errmsg(raw)
407 : "cannot open operational ledger";
408 if (raw != nullptr) {
409 sqlite3_close(raw);
410 }
411 throw std::runtime_error(message);
412 }
414 if (sqlite3_busy_timeout(
database.get(), 5000) != SQLITE_OK) {
416 database.get(),
"configure operational-ledger timeout"
417 );
418 }
423CREATE TABLE IF NOT EXISTS envelopes (
const std::filesystem::path & path() const noexcept
void throw_sqlite(sqlite3 *database, std::string_view context)
void execute(sqlite3 *database, std::string_view sql)
References implementation().
Referenced by implementation().
◆ implementation() [2/2]
| arachne::coordination::operational_ledger::implementation::implementation |
( |
const std::filesystem::path & | path | ) |
|
|
inlineexplicit |
Definition at line 395 of file coordinator.cpp.
396 :
database(
nullptr, sqlite3_close) {
397 sqlite3* raw = nullptr;
398 if (sqlite3_open_v2(
399 path.string().c_str(), &raw,
400 SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE
401 | SQLITE_OPEN_FULLMUTEX,
402 nullptr
403 )
404 != SQLITE_OK) {
405 const std::string message = raw != nullptr
406 ? sqlite3_errmsg(raw)
407 : "cannot open operational ledger";
408 if (raw != nullptr) {
409 sqlite3_close(raw);
410 }
411 throw std::runtime_error(message);
412 }
414 if (sqlite3_busy_timeout(
database.get(), 5000) != SQLITE_OK) {
416 database.get(),
"configure operational-ledger timeout"
417 );
418 }
423CREATE TABLE IF NOT EXISTS envelopes (
◆ database
| sqlite_handle arachne::coordination::operational_ledger::implementation::database |
The documentation for this struct was generated from the following file: