Key.h 588 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2021, Jan de Visser <jan@de-visser.net>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <AK/RefPtr.h>
  8. #include <LibSQL/Forward.h>
  9. #include <LibSQL/Tuple.h>
  10. namespace SQL {
  11. class Key : public Tuple {
  12. public:
  13. Key() = default;
  14. explicit Key(NonnullRefPtr<TupleDescriptor> const&);
  15. explicit Key(NonnullRefPtr<IndexDef>);
  16. Key(NonnullRefPtr<TupleDescriptor> const&, Serializer&);
  17. Key(RefPtr<IndexDef>, Serializer&);
  18. RefPtr<IndexDef> index() const { return m_index; }
  19. private:
  20. RefPtr<IndexDef> m_index { nullptr };
  21. };
  22. }