1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

LibSQL: Make TupleDescriptor a shared pointer instead of a stack object

Tuple descriptors are basically the same for for example all rows in
a table. Makes sense to share them instead of copying them for every
single row.
This commit is contained in:
Jan de Visser 2021-07-13 13:47:08 -04:00 committed by Andreas Kling
parent 9e225d2d05
commit a5e28f2897
17 changed files with 95 additions and 94 deletions

View file

@ -107,7 +107,7 @@ public:
[[nodiscard]] size_t size() const { return m_key_definition.size(); }
void append_column(String, SQLType, Order = Order::Ascending);
Key key() const override;
[[nodiscard]] TupleDescriptor to_tuple_descriptor() const;
[[nodiscard]] NonnullRefPtr<TupleDescriptor> to_tuple_descriptor() const;
static NonnullRefPtr<IndexDef> index_def();
static Key make_key(TableDef const& table_def);
@ -132,7 +132,7 @@ public:
size_t num_indexes() { return m_indexes.size(); }
NonnullRefPtrVector<ColumnDef> columns() const { return m_columns; }
NonnullRefPtrVector<IndexDef> indexes() const { return m_indexes; }
[[nodiscard]] TupleDescriptor to_tuple_descriptor() const;
[[nodiscard]] NonnullRefPtr<TupleDescriptor> to_tuple_descriptor() const;
static NonnullRefPtr<IndexDef> index_def();
static Key make_key(SchemaDef const& schema_def);