2021-07-18 14:42:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
2021-07-22 21:27:26 +00:00
|
|
|
#include <Client/ClientBase.h>
|
2021-07-18 14:42:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
2021-07-22 21:27:26 +00:00
|
|
|
class Client : public ClientBase
|
2021-07-18 14:42:41 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
Client() = default;
|
2021-09-11 11:34:22 +00:00
|
|
|
|
2021-07-23 20:56:47 +00:00
|
|
|
void initialize(Poco::Util::Application & self) override;
|
2021-09-11 11:34:22 +00:00
|
|
|
|
2021-09-04 18:19:01 +00:00
|
|
|
int main(const std::vector<String> & /*args*/) override;
|
2021-07-23 20:56:47 +00:00
|
|
|
|
2021-07-18 14:42:41 +00:00
|
|
|
protected:
|
2021-07-28 12:56:11 +00:00
|
|
|
bool processWithFuzzing(const String & full_query) override;
|
2022-08-11 02:34:10 +00:00
|
|
|
std::optional<bool> processFuzzingStep(const String & query_to_execute, const ASTPtr & parsed_query);
|
2021-07-26 22:28:27 +00:00
|
|
|
|
2021-09-04 18:19:01 +00:00
|
|
|
void connect() override;
|
2022-03-14 11:00:47 +00:00
|
|
|
|
2021-08-19 11:07:47 +00:00
|
|
|
void processError(const String & query) const override;
|
2022-03-14 11:00:47 +00:00
|
|
|
|
2021-09-19 21:42:28 +00:00
|
|
|
String getName() const override { return "client"; }
|
2021-07-23 20:56:47 +00:00
|
|
|
|
2024-04-26 11:19:22 +00:00
|
|
|
void printHelpMessage(const OptionsDescription & options_description, bool verbose) override;
|
2022-03-14 11:00:47 +00:00
|
|
|
|
2021-10-14 13:34:05 +00:00
|
|
|
void addOptions(OptionsDescription & options_description) override;
|
2022-03-14 11:00:47 +00:00
|
|
|
|
2022-02-10 09:43:08 +00:00
|
|
|
void processOptions(
|
|
|
|
const OptionsDescription & options_description,
|
|
|
|
const CommandLineOptions & options,
|
|
|
|
const std::vector<Arguments> & external_tables_arguments,
|
|
|
|
const std::vector<Arguments> & hosts_and_ports_arguments) override;
|
2022-03-14 11:00:47 +00:00
|
|
|
|
2021-08-18 14:39:04 +00:00
|
|
|
void processConfig() override;
|
2021-07-22 21:27:26 +00:00
|
|
|
|
2022-03-01 09:22:12 +00:00
|
|
|
void readArguments(
|
|
|
|
int argc,
|
|
|
|
char ** argv,
|
|
|
|
Arguments & common_arguments,
|
|
|
|
std::vector<Arguments> & external_tables_arguments,
|
|
|
|
std::vector<Arguments> & hosts_and_ports_arguments) override;
|
|
|
|
|
2021-07-18 14:42:41 +00:00
|
|
|
private:
|
|
|
|
void printChangedSettings() const;
|
2022-07-20 09:51:55 +00:00
|
|
|
void showWarnings();
|
2023-10-23 14:48:30 +00:00
|
|
|
void parseConnectionsCredentials(Poco::Util::AbstractConfiguration & config, const std::string & connection_name);
|
2021-07-28 12:56:11 +00:00
|
|
|
std::vector<String> loadWarningMessages();
|
2021-07-18 14:42:41 +00:00
|
|
|
};
|
|
|
|
}
|