mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
LibSQL: Allow expressions and column names in SELECT ... FROM
Up to now the only ``SELECT`` statement that worked was ``SELECT * FROM <table>``. This commit allows a column list consisting of column names and expressions in addition to ``*``. ``WHERE`` still doesn't work though.
This commit is contained in:
parent
f33a288ca4
commit
fe50598a03
8 changed files with 90 additions and 20 deletions
|
@ -36,6 +36,11 @@ struct TupleElementDescriptor {
|
|||
{
|
||||
return (sizeof(u32) + name.length()) + 2 * sizeof(u8);
|
||||
}
|
||||
|
||||
String to_string() const
|
||||
{
|
||||
return String::formatted(" name: {} type: {} order: {}", name, SQLType_name(type), Order_name(order));
|
||||
}
|
||||
};
|
||||
|
||||
class TupleDescriptor
|
||||
|
@ -84,6 +89,15 @@ public:
|
|||
return len;
|
||||
}
|
||||
|
||||
String to_string() const
|
||||
{
|
||||
Vector<String> elements;
|
||||
for (auto& element : *this) {
|
||||
elements.append(element.to_string());
|
||||
}
|
||||
return String::formatted("[\n{}\n]", String::join("\n", elements));
|
||||
}
|
||||
|
||||
using Vector<TupleElementDescriptor>::operator==;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue