1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:47:34 +00:00

LibSQL: Ungracefully handle database version incompatibilities

In the long run, this is obviously a bad way to handle version changes
to the SQL database files. We will want to migrate old databases to new
formats. Until we figure out a good way to do that, wipe old databases
so that we don't crash trying to read incompatible data.
This commit is contained in:
Timothy Flynn 2022-12-11 11:41:22 -05:00 committed by Tim Flynn
parent d5ed07fdc4
commit b5fd96b7ac
3 changed files with 15 additions and 3 deletions

View file

@ -33,6 +33,8 @@ class Heap : public Core::Object {
C_OBJECT(Heap);
public:
static constexpr inline u32 current_version = 1;
virtual ~Heap() override;
ErrorOr<void> open();
@ -104,7 +106,7 @@ private:
u32 m_schemas_root { 0 };
u32 m_tables_root { 0 };
u32 m_table_columns_root { 0 };
u32 m_version { 0x00000001 };
u32 m_version { current_version };
Array<u32, 16> m_user_values { 0 };
HashMap<u32, ByteBuffer> m_write_ahead_log;
};