#include "sql/meta_table.h"
#include <cstdint>
#include <string>
#include <string_view>
#include "base/check.h"
#include "base/check_op.h"
#include "sql/database.h"
#include "sql/statement.h"
#include "sql/statement_id.h"
#include "sql/transaction.h"
namespace sql {
namespace {
constexpr char kVersionKey[] = …;
constexpr char kCompatibleVersionKey[] = …;
constexpr char kMmapStatusKey[] = …;
bool PrepareSetStatement(std::string_view key,
Database& db,
Statement& insert_statement) { … }
bool PrepareGetStatement(std::string_view key,
Database& db,
Statement& select_statement) { … }
}
MetaTable::MetaTable() = default;
MetaTable::~MetaTable() = default;
constexpr int64_t MetaTable::kMmapFailure;
constexpr int64_t MetaTable::kMmapSuccess;
bool MetaTable::DoesTableExist(sql::Database* db) { … }
bool MetaTable::DeleteTableForTesting(sql::Database* db) { … }
bool MetaTable::GetMmapStatus(Database* db, int64_t* status) { … }
bool MetaTable::SetMmapStatus(Database* db, int64_t status) { … }
RazeIfIncompatibleResult MetaTable::RazeIfIncompatible(
Database* db,
int lowest_supported_version,
int current_version) { … }
bool MetaTable::Init(Database* db, int version, int compatible_version) { … }
void MetaTable::Reset() { … }
bool MetaTable::SetVersionNumber(int version) { … }
int MetaTable::GetVersionNumber() { … }
bool MetaTable::SetCompatibleVersionNumber(int version) { … }
int MetaTable::GetCompatibleVersionNumber() { … }
bool MetaTable::SetValue(std::string_view key, const std::string& value) { … }
bool MetaTable::SetValue(std::string_view key, int64_t value) { … }
bool MetaTable::GetValue(std::string_view key, std::string* value) { … }
bool MetaTable::GetValue(std::string_view key, int* value) { … }
bool MetaTable::GetValue(std::string_view key, int64_t* value) { … }
bool MetaTable::DeleteKey(std::string_view key) { … }
}