2021-06-17 13:47:42 -04:00
|
|
|
/*
|
|
|
|
* 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 {
|
|
|
|
|
2021-07-13 13:47:08 -04:00
|
|
|
Key::Key(NonnullRefPtr<TupleDescriptor> const& descriptor)
|
2021-06-17 13:47:42 -04:00
|
|
|
: Tuple(descriptor)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-07-13 13:47:08 -04:00
|
|
|
Key::Key(NonnullRefPtr<IndexDef> index)
|
2021-06-17 13:47:42 -04:00
|
|
|
: Tuple(index->to_tuple_descriptor())
|
|
|
|
, m_index(index)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-08-18 20:50:13 -04:00
|
|
|
Key::Key(NonnullRefPtr<TupleDescriptor> const& descriptor, Serializer& serializer)
|
|
|
|
: Tuple(descriptor, serializer)
|
2021-06-17 13:47:42 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-08-18 20:50:13 -04:00
|
|
|
Key::Key(RefPtr<IndexDef> index, Serializer& serializer)
|
2021-06-17 13:47:42 -04:00
|
|
|
: Key(index->to_tuple_descriptor())
|
|
|
|
{
|
2021-08-18 20:50:13 -04:00
|
|
|
Tuple::deserialize(serializer);
|
2021-06-17 13:47:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|