Skip to content

Commit

Permalink
grpc/clickhouse: construct query from options
Browse files Browse the repository at this point in the history
Signed-off-by: Attila Szakacs <attila.szakacs@axoflow.com>
  • Loading branch information
alltilla committed Oct 22, 2024
1 parent 93bbb5e commit 4e99781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/grpc/clickhouse/clickhouse-dest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ DestDriver::init()
return false;
}

this->query = "INSERT INTO " + this->database + "." + this->table + " FORMAT Protobuf";

if (!this->schema.init())
return false;

Expand Down
6 changes: 6 additions & 0 deletions modules/grpc/clickhouse/clickhouse-dest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ class DestDriver final : public syslogng::grpc::DestDriver
return this->password;
}

const std::string &get_query()
{
return this->query;
}

Schema *get_schema()
{
return &this->schema;
Expand All @@ -98,6 +103,7 @@ class DestDriver final : public syslogng::grpc::DestDriver
std::string table;
std::string user;
std::string password;
std::string query;

Schema schema;
};
Expand Down

0 comments on commit 4e99781

Please # to comment.