mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 20:17:13 +02: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:
committed by
Andreas Kling
parent
f33a288ca4
commit
fe50598a03
Notes:
sideshowbarker
2024-07-18 03:02:56 +09:00
Author: https://github.com/JanDeVisser Commit: https://github.com/SerenityOS/serenity/commit/fe50598a03e Pull-request: https://github.com/SerenityOS/serenity/pull/10094 Reviewed-by: https://github.com/trflynn89 ✅
@@ -298,7 +298,7 @@ private:
|
||||
struct ExecutionContext {
|
||||
NonnullRefPtr<Database> database;
|
||||
RefPtr<SQLResult> result { nullptr };
|
||||
Tuple current_row {};
|
||||
Tuple* current_row { nullptr };
|
||||
};
|
||||
|
||||
class Expression : public ASTNode {
|
||||
@@ -429,6 +429,7 @@ public:
|
||||
const String& schema_name() const { return m_schema_name; }
|
||||
const String& table_name() const { return m_table_name; }
|
||||
const String& column_name() const { return m_column_name; }
|
||||
virtual Value evaluate(ExecutionContext&) const override;
|
||||
|
||||
private:
|
||||
String m_schema_name;
|
||||
|
||||
Reference in New Issue
Block a user