summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibSQL/Key.h
blob: e9a3eb1a745142351d6fbc90ea379daf501223ae (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
/*
 * Copyright (c) 2021, Jan de Visser <jan@de-visser.net>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/RefPtr.h>
#include <LibSQL/Forward.h>
#include <LibSQL/Meta.h>
#include <LibSQL/Tuple.h>

namespace SQL {

class Key : public Tuple {
public:
    Key() = default;
    explicit Key(NonnullRefPtr<TupleDescriptor> const&);
    explicit Key(NonnullRefPtr<IndexDef>);
    Key(NonnullRefPtr<TupleDescriptor> const&, Serializer&);
    Key(RefPtr<IndexDef>, Serializer&);
    RefPtr<IndexDef> index() const { return m_index; }

private:
    RefPtr<IndexDef> m_index { nullptr };
};

}