12#ifndef tutorial_Writable_Database_declared
13#define tutorial_Writable_Database_declared
35 friend class detail::Client_Data;
46 void check_single_row();
53 bool perform_initialization
69 return journal.get_file().read_blob(blob);
74 return journal.write_blob(data);
79 return journal.ahead_of_checkpoint();
84 journal.soft_checkpoint();
89 journal.hard_checkpoint();
96 void flush()
override {journal.flush();}
115 journal.insert_into(
Table_Id(1),
id.get_record_id());
129 std::string field_value_of_name
133 set_name(result, std::move(field_value_of_name));
145 for (
size_t i = size; i > 0;)
183 journal.insert_into(
Table_Id(2),
id.get_record_id());
197 std::string field_value_of_first_name,
198 std::string field_value_of_last_name,
205 set_home(result, field_value_of_home);
217 for (
size_t i = size; i > 0;)
Handle concurrent access to a joedb::Abstract_File using a joedb::Connection.
void timestamp(int64_t timestamp) override
void comment(const std::string &comment) override
void internal_update_vector_person__first_name(Record_Id record_id, size_t size, const std::string *value)
const std::string & get_last_name(id_of_person record) const
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)
const std::string & get_first_name(id_of_person record) const
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 internal_update_person__first_name(Record_Id record_id, std::string field_value_of_first_name)
void internal_update_person__last_name(Record_Id record_id, std::string field_value_of_last_name)
const std::string & get_name(id_of_city record) const
void internal_update_person__home(Record_Id record_id, id_of_city field_value_of_home)
void internal_insert_city(Record_Id record_id)
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)
void internal_update_city__name(Record_Id record_id, std::string field_value_of_name)
Shortcut to directly build a Writable_Database with a Memory_File.
Write simultaneously to the database and the file (ignore schema changes).
void update_vector_of_last_name(id_of_person record, size_t size, F f)
void soft_checkpoint() override
void clear_person_table()
joedb::Blob write_blob(std::string_view data) override
std::string read_blob(joedb::Blob blob) const
void insert_city(id_of_city id)
int64_t ahead_of_checkpoint() const
void delete_vector_of_city(id_of_city v, size_t size)
id_of_city new_vector_of_city(size_t size)
void hard_checkpoint() override
friend class Memory_Database
void insert_person(id_of_person id)
void update_vector_of_home(id_of_person record, size_t size, F f)
void set_last_name(id_of_person record, std::string field_value_of_last_name)
void update_vector_of_first_name(id_of_person record, size_t size, F f)
id_of_person new_person(std::string field_value_of_first_name, std::string field_value_of_last_name, id_of_city field_value_of_home)
id_of_person new_person()
id_of_city new_city(std::string field_value_of_name)
void set_home(id_of_person record, id_of_city field_value_of_home)
void write_comment(const std::string &comment)
void set_first_name(id_of_person record, std::string field_value_of_first_name)
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)
void set_name(id_of_city record, std::string field_value_of_name)
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
#define JOEDB_DEBUG_ASSERT(x)
assertion tested in debug mode
Automatically generated by joedbc.