12#ifndef tutorial_rpc_city_Database_Writable_declared
13#define tutorial_rpc_city_Database_Writable_declared
29 extern const char * schema_string;
30 inline constexpr size_t schema_string_size = 55;
33 class container_of_city;
44 if (table_id == Table_Id(1))
52 if (table_id == Table_Id(1))
71 if (table_id == Table_Id(1))
90 to_underlying(record_id) < 0 ||
96 if (table_id == Table_Id(1))
109 const std::string& value
113 if (table_id == Table_Id(1))
115 if (field_id == Field_Id(1))
130 const std::string *value
134 if (table_id == Table_Id(1))
136 if (field_id == Field_Id(1))
154 if (table_id == Table_Id(1))
157 if (field_id == Field_Id(1))
159 return (
storage_of_city.field_value_of_name.data() + to_underlying(record_id));
186 schema_file_size < pos ||
187 schema_file_size > detail::schema_string_size ||
190 detail::schema_string + pos,
192 schema_file_size - pos
216 const std::string &name
226 const std::string &name,
234 void drop_field(Table_Id table_id, Field_Id field_id)
override
244 const std::string &name
251 void custom(
const std::string &name)
override
282 throw_exception<joedb::Out_Of_Date>(
"Schema is out of date. Can't upgrade a read-only database.");
bool is_used_vector(Record_Id index, size_t size) const
void replay_log(Writable &writable)
int64_t get_checkpoint() const
void add_field(Table_Id table_id, const std::string &name, Type type) override
void soft_checkpoint() override
void custom(const std::string &name) override
void create_table(const std::string &name) override
void rename_table(Table_Id table_id, const std::string &name) override
void drop_table(Table_Id table_id) override
void rename_field(Table_Id table_id, Field_Id field_id, const std::string &name) override
void drop_field(Table_Id table_id, Field_Id field_id) override
Superclass with all joedb journal event listeners as virtual functions.
virtual void delete_vector(Table_Id table_id, Record_Id record_id, size_t size)=0
implement joedb::Writable in a Database
joedb::index_t max_record_id
void timestamp(int64_t timestamp) override
void initialize_with_readonly_journal(joedb::Readonly_Journal &journal)
void delete_vector(Table_Id table_id, Record_Id record_id, size_t size) override
void create_table(const std::string &name) override
void delete_from(Table_Id table_id, Record_Id record_id) override
void add_field(Table_Id table_id, const std::string &name, joedb::Type type) override
int64_t get_schema_checkpoint() const
joedb::Writable_Journal schema_journal
std::string * get_own_string_storage(Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t &capacity) override
void comment(const std::string &comment) override
void drop_table(Table_Id table_id) override
void valid_data() override
void insert_vector(Table_Id table_id, Record_Id record_id, size_t size) override
bool requires_schema_upgrade() const
void drop_field(Table_Id table_id, Field_Id field_id) override
void update_string(Table_Id table_id, Record_Id record_id, Field_Id field_id, const std::string &value) override
void rename_field(Table_Id table_id, Field_Id field_id, const std::string &name) override
void set_max_record_id(joedb::index_t record_id)
void rename_table(Table_Id table_id, const std::string &name) override
void update_vector_string(Table_Id table_id, Record_Id record_id, Field_Id field_id, size_t size, const std::string *value) override
Table_Id current_table_id
void custom(const std::string &name) override
void insert_into(Table_Id table_id, Record_Id record_id) override
joedb::Memory_File schema_file
Store all the tables of the database.
void internal_insert_city(Record_Id record_id)
void internal_update_city__name(Record_Id record_id, const std::string &field_value_of_name)
bool is_valid_record_id_for_city(Record_Id record_id) const
static void throw_exception(const std::string &message)
detail::data_of_city storage_of_city
void internal_vector_insert_city(Record_Id record_id, size_t size)
void internal_delete_city(Record_Id record_id)
void internal_update_vector_city__name(Record_Id record_id, size_t size, const std::string *value)
#define JOEDB_RELEASE_ASSERT(x)
always-tested assertion (release and debug mode)
Automatically generated by joedbc.