Arachne 1.0
Arachne - the perpetual stitcher of Wikidata entities.
Loading...
Searching...
No Matches
store.cpp File Reference
#include "penelope/store.hpp"
#include "arachne/contracts.hpp"
#include "arachne/crypto.hpp"
#include <nlohmann/json.hpp>
#include <sqlite3.h>
#include <algorithm>
#include <array>
#include <cctype>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <ctime>
#include <fstream>
#include <initializer_list>
#include <map>
#include <optional>
#include <set>
#include <sstream>
#include <string_view>
#include <system_error>
#include <unordered_map>
#include <unordered_set>
#include <utility>
Include dependency graph for store.cpp:

Go to the source code of this file.

Classes

class  arachne::penelope::anonymous_namespace{store.cpp}::statement
class  arachne::penelope::anonymous_namespace{store.cpp}::database
class  arachne::penelope::anonymous_namespace{store.cpp}::transaction
struct  arachne::penelope::anonymous_namespace{store.cpp}::staging_guard
struct  arachne::penelope::anonymous_namespace{store.cpp}::export_table

Namespaces

namespace  arachne
namespace  arachne::penelope
namespace  arachne::penelope::anonymous_namespace{store.cpp}

Typedefs

using arachne::penelope::anonymous_namespace{store.cpp}::json = nlohmann::json

Enumerations

enum class  arachne::penelope::anonymous_namespace{store.cpp}::database_access { arachne::penelope::anonymous_namespace{store.cpp}::ordinary , arachne::penelope::anonymous_namespace{store.cpp}::immutable_readonly , arachne::penelope::anonymous_namespace{store.cpp}::ordinary , arachne::penelope::anonymous_namespace{store.cpp}::immutable_readonly }
enum class  arachne::penelope::anonymous_namespace{store.cpp}::database_access { arachne::penelope::anonymous_namespace{store.cpp}::ordinary , arachne::penelope::anonymous_namespace{store.cpp}::immutable_readonly , arachne::penelope::anonymous_namespace{store.cpp}::ordinary , arachne::penelope::anonymous_namespace{store.cpp}::immutable_readonly }

Functions

void arachne::penelope::anonymous_namespace{store.cpp}::fail (std::string message)
std::string arachne::penelope::anonymous_namespace{store.cpp}::sqlite_message (sqlite3 *db, std::string_view operation)
std::string arachne::penelope::anonymous_namespace{store.cpp}::sqlite_immutable_uri (const fs::path &path)
std::string arachne::penelope::anonymous_namespace{store.cpp}::read_bytes (const fs::path &path)
json arachne::penelope::anonymous_namespace{store.cpp}::read_json (const fs::path &path)
void arachne::penelope::anonymous_namespace{store.cpp}::write_bytes (const fs::path &path, std::string_view bytes)
std::string arachne::penelope::anonymous_namespace{store.cpp}::lowercase (std::string value)
bool arachne::penelope::anonymous_namespace{store.cpp}::is_sha256 (std::string_view value)
void arachne::penelope::anonymous_namespace{store.cpp}::require_sha256 (std::string_view value, std::string_view field)
std::string arachne::penelope::anonymous_namespace{store.cpp}::canonical_json (const json &value)
std::string arachne::penelope::anonymous_namespace{store.cpp}::require_string (const json &object, std::string_view key, std::string_view context)
std::optional< int > arachne::penelope::anonymous_namespace{store.cpp}::optional_integer (const json &object, std::string_view key, std::string_view context)
std::optional< double > arachne::penelope::anonymous_namespace{store.cpp}::optional_number (const json &object, std::string_view key, std::string_view context)
const jsonarachne::penelope::anonymous_namespace{store.cpp}::array_or_empty (const json &object, std::string_view key, std::string_view context)
void arachne::penelope::anonymous_namespace{store.cpp}::configure_connection (const database &db)
fs::path arachne::penelope::anonymous_namespace{store.cpp}::schema_path (std::string_view filename)
void arachne::penelope::anonymous_namespace{store.cpp}::create_candidate_schema (const database &db)
std::string arachne::penelope::anonymous_namespace{store.cpp}::domain_name (graph_domain)
fs::path arachne::penelope::anonymous_namespace{store.cpp}::domain_path (const fs::path &root, graph_domain domain)
std::string arachne::penelope::anonymous_namespace{store.cpp}::read_active_id (const fs::path &root, graph_domain domain)
void arachne::penelope::anonymous_namespace{store.cpp}::write_active_id (const fs::path &root, graph_domain domain, std::string_view id)
fs::path arachne::penelope::anonymous_namespace{store.cpp}::make_staging_directory (const fs::path &root, graph_domain domain, std::string_view seed)
void arachne::penelope::anonymous_namespace{store.cpp}::remove_staging_sqlite_sidecars (const fs::path &database_path, const fs::path &expected_staging_directory)
void arachne::penelope::anonymous_namespace{store.cpp}::validate_stable_contract_id (std::string_view value, std::string_view context)
int arachne::penelope::anonymous_namespace{store.cpp}::require_integer (const json &object, std::string_view key, std::string_view context)
double arachne::penelope::anonymous_namespace{store.cpp}::require_number (const json &object, std::string_view key, std::string_view context)
void arachne::penelope::anonymous_namespace{store.cpp}::require_only_fields (const json &object, std::initializer_list< std::string_view > fields, std::string_view context)
void arachne::penelope::anonymous_namespace{store.cpp}::import_candidate_plan (sqlite3 *db, const json &control, const json &payload)
bool arachne::penelope::anonymous_namespace{store.cpp}::query_has_row (sqlite3 *db, std::string_view sql)
void arachne::penelope::anonymous_namespace{store.cpp}::add_problem_if (integrity_report &report, sqlite3 *db, std::string_view sql, std::string message)
integrity_report arachne::penelope::anonymous_namespace{store.cpp}::inspect_database (graph_domain domain, const fs::path &database_path, const database_access access=database_access::ordinary)
void arachne::penelope::anonymous_namespace{store.cpp}::seal_and_validate_database (const graph_domain domain, const fs::path &database_path)
const std::vector< export_table > & arachne::penelope::anonymous_namespace{store.cpp}::export_tables (graph_domain domain)
json arachne::penelope::anonymous_namespace{store.cpp}::sqlite_value (sqlite3_stmt *statement_value, int column)
snapshot_result arachne::penelope::anonymous_namespace{store.cpp}::snapshot_from_directory (const fs::path &root, graph_domain domain, std::string id, bool verify_hashes)
snapshot_result arachne::penelope::anonymous_namespace{store.cpp}::finalize_snapshot (const fs::path &root, graph_domain domain, staging_guard &staging, std::string snapshot_id, std::string database_hash, std::string export_hash, std::size_t applied, std::size_t skipped)
void arachne::penelope::anonymous_namespace{store.cpp}::require_valid_contract (arachnespace::contracts::contract_name expected, const json &document, std::string_view context)
json arachne::penelope::anonymous_namespace{store.cpp}::read_candidate_payload (const fs::path &path)
std::string arachne::penelope::anonymous_namespace{store.cpp}::utc_now ()
json arachne::penelope::anonymous_namespace{store.cpp}::artifact (std::string storage_ref, std::string sha256, std::uintmax_t byte_length, std::string media_type)
json arachne::penelope::anonymous_namespace{store.cpp}::write_validation_report (const fs::path &staging_path, graph_domain domain, std::string_view snapshot_id)

Variables

constexpr std::string_view arachne::penelope::anonymous_namespace{store.cpp}::candidate_contract = "research_candidate_graph_snapshot_v1"