Skip to content

Commit

Permalink
Basic ClickHouse HTTP query wrapper (#8)
Browse files Browse the repository at this point in the history
* Basic ClickHouse http query macro wrapper
  • Loading branch information
lmangani authored Sep 9, 2024
1 parent db79a6b commit 2e68607
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 238 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
project(${TARGET_NAME})
include_directories(src/include)

set(EXTENSION_SOURCES src/chsql_extension.cpp src/default_table_functions.cpp)
set(EXTENSION_SOURCES src/chsql_extension.cpp)

build_static_extension(${TARGET_NAME} ${EXTENSION_SOURCES})
build_loadable_extension(${TARGET_NAME} " " ${EXTENSION_SOURCES})
Expand Down
3 changes: 2 additions & 1 deletion src/chsql_extension.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ static DefaultMacro chsql_macros[] = {
static const DefaultTableMacro chsql_table_macros[] = {
{DEFAULT_SCHEMA, "tableMultiply", {"x", nullptr}, {{"two", "2"}, {nullptr, nullptr}}, R"(SELECT x * two as output_column;)"},
{DEFAULT_SCHEMA, "numbers", {"x", nullptr}, {{"z", "0"}, {nullptr, nullptr}}, R"(SELECT * as number FROM generate_series(z,x-1);)"},
{nullptr, nullptr, {nullptr}, {{nullptr, nullptr}}, nullptr}
{DEFAULT_SCHEMA, "ch_scan", {"query", "server"}, {{"format", "JSONEachRow"}, {"user", "play"}, {nullptr, nullptr}}, R"(SELECT * FROM read_json_auto(concat(server, '/?default_format=', format, '&user=', user, '&query=', query)))"},
{nullptr, nullptr, {nullptr}, {{nullptr, nullptr}}, nullptr}
};
// clang-format on

Expand Down
148 changes: 0 additions & 148 deletions src/default_table_functions.cpp

This file was deleted.

41 changes: 0 additions & 41 deletions src/include/default_functions.hpp

This file was deleted.

47 changes: 0 additions & 47 deletions src/include/default_table_functions.hpp

This file was deleted.

0 comments on commit 2e68607

Please sign in to comment.