mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-25 11:48:06 +00:00
LibSQL: Move Order and Nulls enums from SQL::AST to SQL namespace
The Order enum is used in the Meta component of LibSQL. Using this enum meant having to include the monster AST/AST.h include file. Furthermore, they are sort of basic and therefore can live in the general SQL namespace. Moved to LibSQL/Type.h. Also introduced a new class, SQLResult, which is needed in future patches.
This commit is contained in:
parent
633dc74606
commit
30691549fd
Notes:
sideshowbarker
2024-07-18 10:04:43 +09:00
Author: https://github.com/JanDeVisser
Commit: 30691549fd
Pull-request: https://github.com/SerenityOS/serenity/pull/8306
Reviewed-by: https://github.com/MaxWipfli
Reviewed-by: https://github.com/alimpfard ✅
Reviewed-by: https://github.com/trflynn89 ✅
13 changed files with 205 additions and 52 deletions
|
@ -13,7 +13,6 @@
|
|||
#include <AK/String.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibCore/Object.h>
|
||||
#include <LibSQL/AST/AST.h>
|
||||
#include <LibSQL/Forward.h>
|
||||
#include <LibSQL/Key.h>
|
||||
#include <LibSQL/Type.h>
|
||||
|
@ -90,11 +89,11 @@ class KeyPartDef : public ColumnDef {
|
|||
C_OBJECT(KeyPartDef);
|
||||
|
||||
public:
|
||||
KeyPartDef(IndexDef*, String, SQLType, AST::Order = AST::Order::Ascending);
|
||||
AST::Order sort_order() const { return m_sort_order; }
|
||||
KeyPartDef(IndexDef*, String, SQLType, Order = Order::Ascending);
|
||||
Order sort_order() const { return m_sort_order; }
|
||||
|
||||
private:
|
||||
AST::Order m_sort_order { AST::Order::Ascending };
|
||||
Order m_sort_order { Order::Ascending };
|
||||
};
|
||||
|
||||
class IndexDef : public Relation {
|
||||
|
@ -106,7 +105,7 @@ public:
|
|||
NonnullRefPtrVector<KeyPartDef> key_definition() const { return m_key_definition; }
|
||||
bool unique() const { return m_unique; }
|
||||
[[nodiscard]] size_t size() const { return m_key_definition.size(); }
|
||||
void append_column(String, SQLType, AST::Order = AST::Order::Ascending);
|
||||
void append_column(String, SQLType, Order = Order::Ascending);
|
||||
Key key() const override;
|
||||
[[nodiscard]] TupleDescriptor to_tuple_descriptor() const;
|
||||
static NonnullRefPtr<IndexDef> index_def();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue