mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:58:11 +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:
parent
2a46529170
commit
224804b424
15 changed files with 2153 additions and 0 deletions
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);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue