ClickHouse/programs/odbc-bridge
2020-05-23 20:09:37 +03:00
..
tests Move all folders inside /dbms one level up (#9974) 2020-04-02 02:51:21 +03:00
CMakeLists.txt Merge branch 'master' into merging_10554 2020-05-13 21:30:26 +03:00
ColumnInfoHandler.cpp find {base,src,programs} -name '*.h' -or -name '*.cpp' | xargs grep -l -P 'LOG_\w+\([^,]+, "[^"]+" \+ [^+]+\);' | xargs sed -i -r -e 's/(LOG_\w+)\(([^,]+), "([^"]+)" \+ ([^+]+)\);/\1_FORMATTED(\2, "\3{}", \4);/' 2020-05-23 20:09:37 +03:00
ColumnInfoHandler.h Poco contrib refactoring (#10396) 2020-05-08 17:11:19 +03:00
getIdentifierQuote.cpp minor fixes 2020-05-15 00:51:07 +03:00
getIdentifierQuote.h minor fixes 2020-05-15 00:51:07 +03:00
HandlerFactory.cpp find {base,src,programs} -name '*.h' -or -name '*.cpp' | xargs grep -l -P 'LOG_\w+\([^,]+, "[^"]+" \+ [^+]+\);' | xargs sed -i -r -e 's/(LOG_\w+)\(([^,]+), "([^"]+)" \+ ([^+]+)\);/\1_FORMATTED(\2, "\3{}", \4);/' 2020-05-23 20:09:37 +03:00
HandlerFactory.h Remove shared_ptr to SharedContext from Context. 2020-04-17 12:47:40 +03:00
IdentifierQuoteHandler.cpp find {base,src,programs} -name '*.h' -or -name '*.cpp' | xargs grep -l -P 'LOG_\w+\([^,]+, "[^"]+" \+ [^+]+\);' | xargs sed -i -r -e 's/(LOG_\w+)\(([^,]+), "([^"]+)" \+ ([^+]+)\);/\1_FORMATTED(\2, "\3{}", \4);/' 2020-05-23 20:09:37 +03:00
IdentifierQuoteHandler.h Poco contrib refactoring (#10396) 2020-05-08 17:11:19 +03:00
MainHandler.cpp find {base,src,programs} -name '*.h' -or -name '*.cpp' | xargs grep -l -P 'LOG_\w+\([^,]+, "[^"]+" \+ [^+]+\);' | xargs sed -i -r -e 's/(LOG_\w+)\(([^,]+), "([^"]+)" \+ ([^+]+)\);/\1_FORMATTED(\2, "\3{}", \4);/' 2020-05-23 20:09:37 +03:00
MainHandler.h Merge branch 'master' into merging_10554 2020-05-13 21:30:26 +03:00
odbc-bridge.cpp Move all folders inside /dbms one level up (#9974) 2020-04-02 02:51:21 +03:00
ODBCBlockInputStream.cpp Move all folders inside /dbms one level up (#9974) 2020-04-02 02:51:21 +03:00
ODBCBlockInputStream.h Move all folders inside /dbms one level up (#9974) 2020-04-02 02:51:21 +03:00
ODBCBlockOutputStream.cpp Enable clang-tidy for programs and utils 2020-05-18 04:19:50 +03:00
ODBCBlockOutputStream.h minor fixes 2020-05-15 00:51:07 +03:00
ODBCBridge.cpp find {base,src,programs} -name '*.h' -or -name '*.cpp' | xargs grep -l -P 'LOG_\w+\([^,]+, "[^"]+" \+ [^+]+\);' | xargs sed -i -r -e 's/(LOG_\w+)\(([^,]+), "([^"]+)" \+ ([^+]+)\);/\1_FORMATTED(\2, "\3{}", \4);/' 2020-05-23 20:09:37 +03:00
ODBCBridge.h Remove shared_ptr to SharedContext from Context. 2020-04-17 12:47:40 +03:00
PingHandler.cpp Move all folders inside /dbms one level up (#9974) 2020-04-02 02:51:21 +03:00
PingHandler.h Move all folders inside /dbms one level up (#9974) 2020-04-02 02:51:21 +03:00
README.md Move all folders inside /dbms one level up (#9974) 2020-04-02 02:51:21 +03:00
validateODBCConnectionString.cpp Move all folders inside /dbms one level up (#9974) 2020-04-02 02:51:21 +03:00
validateODBCConnectionString.h Move all folders inside /dbms one level up (#9974) 2020-04-02 02:51:21 +03:00

clickhouse-odbc-bridge

Simple HTTP-server which works like a proxy for ODBC driver. The main motivation was possible segfaults or another faults in ODBC implementations, which can crash whole clickhouse-server process.

This tool works via HTTP, not via pipes, shared memory, or TCP because:

  • It's simpler to implement
  • It's simpler to debug
  • jdbc-bridge can be implemented in the same way

Usage

clickhouse-server use this tool inside odbc table function and StorageODBC. However it can be used as standalone tool from command line with the following parameters in POST-request URL:

  • connection_string -- ODBC connection string.
  • columns -- columns in ClickHouse NamesAndTypesList format, name in backticks, type as string. Name and type are space separated, rows separated with newline.
  • max_block_size -- optional parameter, sets maximum size of single block. Query is send in post body. Response is returned in RowBinary format.

Example:

$ clickhouse-odbc-bridge --http-port 9018 --daemon

$ curl -d "query=SELECT PageID, ImpID, AdType FROM Keys ORDER BY PageID, ImpID" --data-urlencode "connection_string=DSN=ClickHouse;DATABASE=stat" --data-urlencode "columns=columns format version: 1
3 columns:
\`PageID\` String
\`ImpID\` String
\`AdType\` String
"  "http://localhost:9018/" > result.txt

$ cat result.txt
12246623837185725195925621517