mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 09:36:08 +00:00
LibSQL: Implement a DESCRIBE TABLE statement
This statement (for now) outputs the name and types of the different attributes in a table. It's not standard SQL but all DBMSs that I know of implement a sort of statement for such functionality. Since the output of DESCRIBE TABLE is just a relation, an internal schema, `master` was created and a table definition for DESCRIBE into it. The table definition and the master schema are not accessible by the user.
This commit is contained in:
parent
cd4dba87fa
commit
f6233913ad
Notes:
sideshowbarker
2024-07-17 19:47:13 +09:00
Author: https://github.com/i3abghany
Commit: f6233913ad
Pull-request: https://github.com/SerenityOS/serenity/pull/10371
Reviewed-by: https://github.com/trflynn89 ✅
9 changed files with 93 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
||||
* Copyright (c) 2021, Mahmoud Mandour <ma.mandourr@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -1050,4 +1051,18 @@ private:
|
|||
RefPtr<LimitClause> m_limit_clause;
|
||||
};
|
||||
|
||||
class DescribeTable : public Statement {
|
||||
public:
|
||||
DescribeTable(NonnullRefPtr<QualifiedTableName> qualified_table_name)
|
||||
: m_qualified_table_name(move(qualified_table_name))
|
||||
{
|
||||
}
|
||||
|
||||
NonnullRefPtr<QualifiedTableName> qualified_table_name() const { return m_qualified_table_name; }
|
||||
RefPtr<SQLResult> execute(ExecutionContext&) const override;
|
||||
|
||||
private:
|
||||
NonnullRefPtr<QualifiedTableName> m_qualified_table_name;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue