12#ifndef tutorial_Writable_Database_declared
13#define tutorial_Writable_Database_declared
31 friend class detail::Client_Data;
41 void check_single_row();
55 bool perform_initialization,
139 const std::string& field_value_of_name
143 set_name(result, field_value_of_name);
155 for (
size_t i = size; i > 0;)
162 journal.update_string(Table_Id(1), record.
get_record_id(), Field_Id(1), field_value_of_name);
167 std::exception_ptr exception;
170 catch (...) {exception = std::current_exception();}
172 journal.update_vector_string(Table_Id(1), record.
get_record_id(), Field_Id(1), size, (span.
begin()));
174 std::rethrow_exception(exception);
201 const std::string& field_value_of_first_name,
202 const std::string& field_value_of_last_name,
209 set_home(result, field_value_of_home);
221 for (
size_t i = size; i > 0;)
228 journal.update_string(Table_Id(2), record.
get_record_id(), Field_Id(1), field_value_of_first_name);
233 std::exception_ptr exception;
236 catch (...) {exception = std::current_exception();}
238 journal.update_vector_string(Table_Id(2), record.
get_record_id(), Field_Id(1), size, (span.
begin()));
240 std::rethrow_exception(exception);
246 journal.update_string(Table_Id(2), record.
get_record_id(), Field_Id(2), field_value_of_last_name);
251 std::exception_ptr exception;
254 catch (...) {exception = std::current_exception();}
256 journal.update_vector_string(Table_Id(2), record.
get_record_id(), Field_Id(2), size, (span.
begin()));
258 std::rethrow_exception(exception);
269 std::exception_ptr exception;
272 catch (...) {exception = std::current_exception();}
274 journal.update_vector_reference(Table_Id(2), record.
get_record_id(), Field_Id(3), size,
reinterpret_cast<Record_Id *
>(span.
begin()));
276 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
void insert_vector(Table_Id table_id, Record_Id record_id, size_t size) final
int64_t ahead_of_checkpoint() const noexcept
void delete_from(Table_Id table_id, Record_Id record_id) final
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_person__first_name(Record_Id record_id, size_t size, const std::string *value)
void internal_update_vector_city__name(Record_Id record_id, size_t size, const std::string *value)
void internal_insert_person(Record_Id record_id)
void internal_update_vector_person__home(Record_Id record_id, size_t size, const id_of_city *value)
detail::data_of_city storage_of_city
detail::data_of_person storage_of_person
void internal_update_vector_person__last_name(Record_Id record_id, size_t size, const std::string *value)
void comment(const std::string &comment) override
void timestamp(int64_t timestamp) override
void internal_update_person__home(Record_Id record_id, id_of_city field_value_of_home)
void internal_update_person__first_name(Record_Id record_id, const std::string &field_value_of_first_name)
void internal_update_person__last_name(Record_Id record_id, const std::string &field_value_of_last_name)
void internal_insert_city(Record_Id record_id)
void internal_update_city__name(Record_Id record_id, const std::string &field_value_of_name)
void internal_delete_person(Record_Id record_id)
void internal_delete_city(Record_Id record_id)
void internal_vector_insert_city(Record_Id record_id, size_t size)
void internal_vector_insert_person(Record_Id record_id, size_t size)
Write simultaneously to the database and the file (ignore schema changes)
A writable Database constructed from a writable joedb::Buffered_File.
void update_vector_of_last_name(id_of_person record, size_t size, F f)
id_of_person new_person(const std::string &field_value_of_first_name, const std::string &field_value_of_last_name, id_of_city field_value_of_home)
void clear_person_table()
void set_name(id_of_city record, const std::string &field_value_of_name)
int64_t ahead_of_checkpoint() const
void delete_vector_of_city(id_of_city v, size_t size)
void set_first_name(id_of_person record, const std::string &field_value_of_first_name)
id_of_city new_vector_of_city(size_t size)
void checkpoint_full_commit()
void checkpoint(joedb::Commit_Level commit_level) final
void update_vector_of_home(id_of_person record, size_t size, F f)
void set_last_name(id_of_person record, const std::string &field_value_of_last_name)
void update_vector_of_first_name(id_of_person record, size_t size, F f)
joedb::Blob write_blob_data(const std::string &data) final
std::string read_blob_data(joedb::Blob blob) const
id_of_city new_city(const std::string &field_value_of_name)
id_of_person new_person()
void set_home(id_of_person record, id_of_city field_value_of_home)
void write_comment(const std::string &comment)
const joedb::Readonly_Journal & get_journal() const
void delete_vector_of_person(id_of_person v, size_t size)
void checkpoint_half_commit()
void update_vector_of_name(id_of_city record, size_t size, F f)
void checkpoint_no_commit()
void delete_city(id_of_city record)
id_of_person new_vector_of_person(size_t size)
void delete_person(id_of_person record)
Strongly-typed wrapper around an integer representing a row of the city table.
constexpr Record_Id get_record_id() const
constexpr size_t get_id() const
Strongly-typed wrapper around an integer representing a row of the person table.
constexpr Record_Id get_record_id() const
constexpr size_t get_id() const
Automatically generated by joedbc.