2012-06-18 07:49:19 +00:00
|
|
|
#pragma once
|
|
|
|
|
2017-04-16 05:40:17 +00:00
|
|
|
#include <iomanip>
|
2017-04-01 09:19:00 +00:00
|
|
|
#include <Parsers/IAST.h>
|
|
|
|
#include <Parsers/ASTQueryWithOutput.h>
|
2012-06-18 07:49:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
|
2022-06-23 15:46:27 +00:00
|
|
|
/** Query SHOW TABLES or SHOW DATABASES or SHOW CLUSTERS or SHOW CACHES
|
2012-06-18 07:49:19 +00:00
|
|
|
*/
|
2013-02-20 13:14:12 +00:00
|
|
|
class ASTShowTablesQuery : public ASTQueryWithOutput
|
2012-06-18 07:49:19 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-12-17 15:26:24 +00:00
|
|
|
bool databases{false};
|
2020-06-05 09:13:13 +00:00
|
|
|
bool clusters{false};
|
|
|
|
bool cluster{false};
|
2019-10-11 13:21:52 +00:00
|
|
|
bool dictionaries{false};
|
2020-12-14 02:33:51 +00:00
|
|
|
bool m_settings{false};
|
2020-12-15 06:44:39 +00:00
|
|
|
bool changed{false};
|
2018-01-25 17:50:57 +00:00
|
|
|
bool temporary{false};
|
2022-06-23 15:46:27 +00:00
|
|
|
bool caches{false};
|
2022-12-03 20:42:18 +00:00
|
|
|
bool full{false};
|
2020-07-05 15:57:59 +00:00
|
|
|
|
2020-06-05 09:13:13 +00:00
|
|
|
String cluster_str;
|
2012-06-18 07:49:19 +00:00
|
|
|
String from;
|
|
|
|
String like;
|
2020-07-05 15:57:59 +00:00
|
|
|
|
2014-12-17 15:26:24 +00:00
|
|
|
bool not_like{false};
|
2020-07-05 15:57:59 +00:00
|
|
|
bool case_insensitive_like{false};
|
|
|
|
|
2020-02-11 11:35:30 +00:00
|
|
|
ASTPtr where_expression;
|
2019-09-15 16:07:27 +00:00
|
|
|
ASTPtr limit_length;
|
2012-06-18 07:49:19 +00:00
|
|
|
|
2017-05-27 17:27:16 +00:00
|
|
|
/** Get the text that identifies this element. */
|
2018-12-07 12:34:40 +00:00
|
|
|
String getID(char) const override { return "ShowTables"; }
|
2012-06-18 07:49:19 +00:00
|
|
|
|
2019-06-29 16:58:32 +00:00
|
|
|
ASTPtr clone() const override;
|
2015-08-06 03:26:27 +00:00
|
|
|
|
2023-02-02 01:11:16 +00:00
|
|
|
QueryKind getQueryKind() const override { return QueryKind::Show; }
|
|
|
|
|
2015-08-06 03:26:27 +00:00
|
|
|
protected:
|
2020-09-09 03:24:47 +00:00
|
|
|
void formatLike(const FormatSettings & settings) const;
|
|
|
|
void formatLimit(const FormatSettings & settings, FormatState & state, FormatStateStacked frame) const;
|
2019-06-29 16:58:32 +00:00
|
|
|
void formatQueryImpl(const FormatSettings & settings, FormatState &, FormatStateStacked) const override;
|
2012-06-18 07:49:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|