12#ifndef settings_Writable_Database_declared
13#define settings_Writable_Database_declared
31 friend class detail::Client_Data;
41 void check_single_row();
55 const std::string &name,
59 void create_table(
const std::string &name)
override;
64 bool perform_initialization,
132 journal.
insert_into(Table_Id(1), result.get_record_id());
138 bool field_value_of_dark_mode,
139 const std::string& field_value_of_host,
140 const std::string& field_value_of_user
143 auto result = new_settings();
145 set_host(result, field_value_of_host);
146 set_user(result, field_value_of_user);
154 journal.update_boolean(Table_Id(1), record.
get_record_id(), Field_Id(1), field_value_of_dark_mode);
159 std::exception_ptr exception;
162 catch (...) {exception = std::current_exception();}
164 journal.update_vector_boolean(Table_Id(1), record.
get_record_id(), Field_Id(1), size, (span.
begin()));
166 std::rethrow_exception(exception);
172 journal.update_string(Table_Id(1), record.
get_record_id(), Field_Id(2), field_value_of_host);
177 std::exception_ptr exception;
180 catch (...) {exception = std::current_exception();}
182 journal.update_vector_string(Table_Id(1), record.
get_record_id(), Field_Id(2), size, (span.
begin()));
184 std::rethrow_exception(exception);
190 journal.update_string(Table_Id(1), record.
get_record_id(), Field_Id(3), field_value_of_user);
195 std::exception_ptr exception;
198 catch (...) {exception = std::current_exception();}
200 journal.update_vector_string(Table_Id(1), record.
get_record_id(), Field_Id(3), size, (span.
begin()));
202 std::rethrow_exception(exception);
virtual std::string read_blob_data(Blob blob) const
const Buffered_File & get_file() const
Blob write_blob_data(const std::string &data) final
int64_t ahead_of_checkpoint() const noexcept
void insert_into(Table_Id table_id, Record_Id record_id) final
void checkpoint(Commit_Level commit_level) final
void default_checkpoint()
Handle concurrent access to a joedb::Buffered_File using a joedb::Connection.
Store all the tables of the database.
void internal_update_vector_settings__dark_mode(Record_Id record_id, size_t size, const char *value)
void internal_update_settings__dark_mode(Record_Id record_id, bool field_value_of_dark_mode)
void internal_insert_settings(Record_Id record_id)
friend class id_of_settings
void internal_update_vector_settings__user(Record_Id record_id, size_t size, const std::string *value)
void timestamp(int64_t timestamp) override
void internal_update_settings__host(Record_Id record_id, const std::string &field_value_of_host)
void internal_update_vector_settings__host(Record_Id record_id, size_t size, const std::string *value)
detail::data_of_settings storage_of_settings
void internal_update_settings__user(Record_Id record_id, const std::string &field_value_of_user)
void comment(const std::string &comment) override
Write simultaneously to the database and the file (ignore schema changes)
A writable Database constructed from a writable joedb::Buffered_File.
void set_dark_mode(id_of_settings record, bool field_value_of_dark_mode)
void checkpoint_half_commit()
void write_comment(const std::string &comment)
const joedb::Readonly_Journal & get_journal() const
void update_vector_of_dark_mode(id_of_settings record, size_t size, F f)
void set_user(id_of_settings record, const std::string &field_value_of_user)
std::string read_blob_data(joedb::Blob blob) const
void checkpoint_full_commit()
void update_vector_of_host(id_of_settings record, size_t size, F f)
joedb::Blob write_blob_data(const std::string &data) final
void set_host(id_of_settings record, const std::string &field_value_of_host)
int64_t ahead_of_checkpoint() const
void checkpoint_no_commit()
void update_vector_of_user(id_of_settings record, size_t size, F f)
void checkpoint(joedb::Commit_Level commit_level) final
Strongly-typed wrapper around an integer representing a row of the settings table.
constexpr size_t get_id() const
constexpr Record_Id get_record_id() const
Automatically generated by joedbc.