mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibSQL: BTree index, Heap, and Meta objects for SQL Storage layer
Unfortunately this patch is quite large. The main functionality included are a BTree index implementation and the Heap class which manages persistent storage. Also included are a Key subclass of the Tuple class, which is a specialization for index key tuples. This "dragged in" the Meta layer, which has classes defining SQL objects like tables and indexes.
This commit is contained in:
committed by
Andreas Kling
parent
2a46529170
commit
224804b424
39
Userland/Libraries/LibSQL/Key.cpp
Normal file
39
Userland/Libraries/LibSQL/Key.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Jan de Visser <jan@de-visser.net>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibSQL/Key.h>
|
||||
#include <LibSQL/Meta.h>
|
||||
|
||||
namespace SQL {
|
||||
|
||||
Key::Key()
|
||||
: Tuple()
|
||||
{
|
||||
}
|
||||
|
||||
Key::Key(TupleDescriptor const& descriptor)
|
||||
: Tuple(descriptor)
|
||||
{
|
||||
}
|
||||
|
||||
Key::Key(RefPtr<IndexDef> index)
|
||||
: Tuple(index->to_tuple_descriptor())
|
||||
, m_index(index)
|
||||
{
|
||||
}
|
||||
|
||||
Key::Key(TupleDescriptor const& descriptor, ByteBuffer& buffer, size_t& offset)
|
||||
: Tuple(descriptor, buffer, offset)
|
||||
{
|
||||
}
|
||||
|
||||
Key::Key(RefPtr<IndexDef> index, ByteBuffer& buffer, size_t& offset)
|
||||
: Key(index->to_tuple_descriptor())
|
||||
{
|
||||
deserialize(buffer, offset);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user