48 void Writable_Database::play_journal()
52 ready_to_write =
false;
54 ready_to_write =
true;
59 void Writable_Database::auto_upgrade()
64 if (file_schema_size < detail::schema_string_size)
66 journal.
comment(
"Automatic schema upgrade");
85 void Writable_Database::initialize()
95 Writable_Database::Writable_Database
100 bool perform_initialization
102 journal(
joedb::Journal_Construction_Lock(file, recovery))
106 if (perform_initialization)
118 Writable_Database::Writable_Database
129 void Writable_Database::check_single_row()
140 void Writable_Database::create_table(
const std::string &name)
153 void Writable_Database::add_field
157 const std::string &name,
163 if (table_id == Table_Id{1})
165 const auto field_id = ++storage_of_settings.current_field_id;
166 if (upgrading_schema)
168 if (field_id == Field_Id{1})
170 for (
const auto record: get_settings_table())
171 set_dark_mode(record, true);
173 if (field_id == Field_Id{2})
175 for (
const auto record: get_settings_table())
176 set_host(record,
"www.kayufu.com");
178 if (field_id == Field_Id{3})
180 for (
const auto record: get_settings_table())
181 set_user(record,
"joe");
int64_t get_size() const override
Get the size of the file, or -1 if it is unknown.
void raw_play_until(Writable &writable, int64_t end)
void play_until_checkpoint(Writable &writable)
int64_t get_checkpoint() const
void skip_directly_to(int64_t position)
void valid_data() override
void soft_checkpoint() override
void timestamp(int64_t timestamp) override
void comment(const std::string &comment) override
joedb::Memory_File schema_file
joedb::index_t max_record_id
void comment(const std::string &comment) override
void add_field(Table_Id table_id, const std::string &name, joedb::Type type) override
joedb::Writable_Journal schema_journal
Table_Id current_table_id
void timestamp(int64_t timestamp) override
void create_table(const std::string &name) override
static constexpr id_of_settings the_settings()
container_of_settings get_settings_table() const
A Database that contains a joedb::Writable_Journal and keeps them in sync.
void write_comment(const std::string &comment)
Automatically generated by joedbc.