12#ifndef tutorial_Writable_Database_declared
13#define tutorial_Writable_Database_declared
31 friend class detail::Client_Data;
41 void check_single_row();
54 bool perform_initialization
116 const std::string& field_value_of_name
120 set_name(result, field_value_of_name);
132 for (
size_t i = size; i > 0;)
140 journal.update_string(Table_Id(1), record.
get_record_id(), Field_Id(1), field_value_of_name);
145 std::exception_ptr exception;
148 catch (...) {exception = std::current_exception();}
150 journal.update_vector_string(Table_Id(1), record.
get_record_id(), Field_Id(1), size, (span.
begin()));
152 std::rethrow_exception(exception);
179 const std::string& field_value_of_first_name,
180 const std::string& field_value_of_last_name,
187 set_home(result, field_value_of_home);
199 for (
size_t i = size; i > 0;)
207 journal.update_string(Table_Id(2), record.
get_record_id(), Field_Id(1), field_value_of_first_name);
212 std::exception_ptr exception;
215 catch (...) {exception = std::current_exception();}
217 journal.update_vector_string(Table_Id(2), record.
get_record_id(), Field_Id(1), size, (span.
begin()));
219 std::rethrow_exception(exception);
225 journal.update_string(Table_Id(2), record.
get_record_id(), Field_Id(2), field_value_of_last_name);
230 std::exception_ptr exception;
233 catch (...) {exception = std::current_exception();}
235 journal.update_vector_string(Table_Id(2), record.
get_record_id(), Field_Id(2), size, (span.
begin()));
237 std::rethrow_exception(exception);
248 std::exception_ptr exception;
251 catch (...) {exception = std::current_exception();}
253 journal.update_vector_reference(Table_Id(2), record.
get_record_id(), Field_Id(3), size,
reinterpret_cast<Record_Id *
>(span.
begin()));
255 std::rethrow_exception(exception);
const Buffered_File & get_file() const
void delete_vector(Table_Id table_id, Record_Id record_id, size_t size) final
void insert_vector(Table_Id table_id, Record_Id record_id, size_t size) final
int64_t ahead_of_checkpoint() const noexcept
Blob write_blob(const std::string &data) final
void delete_from(Table_Id table_id, Record_Id record_id) final
void insert_into(Table_Id table_id, Record_Id record_id) final
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)
std::string read_blob(joedb::Blob blob) const
int64_t ahead_of_checkpoint() const
void delete_vector_of_city(id_of_city v, size_t size)
joedb::Blob write_blob(const std::string &data) final
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 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)
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 update_vector_of_name(id_of_city record, size_t size, F f)
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 auto get_id() const
constexpr Record_Id get_record_id() const
Strongly-typed wrapper around an integer representing a row of the person table.
constexpr Record_Id get_record_id() const
constexpr auto get_id() const
Automatically generated by joedbc.