summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibSQL/Key.cpp
blob: a31c04040396f23c6473a372165c7c22dff77ccd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * 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(NonnullRefPtr<TupleDescriptor> const& descriptor)
    : Tuple(descriptor)
{
}

Key::Key(NonnullRefPtr<IndexDef> index)
    : Tuple(index->to_tuple_descriptor())
    , m_index(index)
{
}

Key::Key(NonnullRefPtr<TupleDescriptor> const& descriptor, Serializer& serializer)
    : Tuple(descriptor, serializer)
{
}

Key::Key(RefPtr<IndexDef> index, Serializer& serializer)
    : Key(index->to_tuple_descriptor())
{
    Tuple::deserialize(serializer);
}

}