Key.h 613 B

1234567891011121314151617181920212223242526272829
  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/Meta.h>
  10. #include <LibSQL/Tuple.h>
  11. namespace SQL {
  12. class Key : public Tuple {
  13. public:
  14. Key() = default;
  15. explicit Key(NonnullRefPtr<TupleDescriptor> const&);
  16. explicit Key(NonnullRefPtr<IndexDef>);
  17. Key(NonnullRefPtr<TupleDescriptor> const&, Serializer&);
  18. Key(RefPtr<IndexDef>, Serializer&);
  19. RefPtr<IndexDef> index() const { return m_index; }
  20. private:
  21. RefPtr<IndexDef> m_index { nullptr };
  22. };
  23. }