ClickHouse/dbms/programs/odbc-bridge
2019-03-04 20:47:31 +03:00
..
tests Fix link in split mode (#4574) 2019-03-04 20:47:31 +03:00
CMakeLists.txt Fix link in split mode (#4574) 2019-03-04 20:47:31 +03:00
ColumnInfoHandler.cpp Added more style checks [#CLICKHOUSE-3] 2018-11-23 21:52:00 +03:00
ColumnInfoHandler.h Update ColumnInfoHandler.h 2018-08-19 23:13:22 +03:00
getIdentifierQuote.cpp Build fixes (#3419) 2018-10-18 22:28:05 +03:00
getIdentifierQuote.h Added some warnings from clang's -Weverything 2019-01-04 16:32:08 +03:00
HandlerFactory.cpp Added more style checks [#CLICKHOUSE-3] 2018-11-23 21:52:00 +03:00
HandlerFactory.h Implement quote getter from ODBC 2018-09-27 18:23:42 +03:00
IdentifierQuoteHandler.cpp Build fixes (#3419) 2018-10-18 22:28:05 +03:00
IdentifierQuoteHandler.h fix formatting errors according code review 2018-10-03 13:44:43 +03:00
MainHandler.cpp Added a test 2019-02-22 20:16:11 +03:00
MainHandler.h CLICKHOUSE-3878: Move last interaction with ODBC from main code to bridge, split Handlers file on three different, slightly remove copy-paste code 2018-08-19 20:09:54 +03:00
odbc-bridge.cpp CLICKHOUSE-3878: Add inherited fd's closing function 2018-08-12 15:23:22 +03:00
ODBCBlockInputStream.cpp Fix split link of dbms/programs/odbc-bridge 2019-02-12 00:43:29 +03:00
ODBCBlockInputStream.h Build fixes (FreeBSD port) (#4397) 2019-02-15 14:46:07 +03:00
ODBCBridge.cpp Remove idiotic if 2018-12-17 23:11:19 +03:00
ODBCBridge.h CLICKHOUSE-3878: Move connection string validation to common, remove redundant headers, fix compilation issues 2018-08-14 13:33:41 +03:00
PingHandler.cpp CLICKHOUSE-3878: Move last interaction with ODBC from main code to bridge, split Handlers file on three different, slightly remove copy-paste code 2018-08-19 20:09:54 +03:00
PingHandler.h CLICKHOUSE-3878: Move last interaction with ODBC from main code to bridge, split Handlers file on three different, slightly remove copy-paste code 2018-08-19 20:09:54 +03:00
README.md Fix typo in readme 2018-10-13 15:28:08 +03:00
validateODBCConnectionString.cpp dbms: Fixed misspells in comments 2019-01-23 04:56:53 +09:00
validateODBCConnectionString.h Fixed typos in code #3373 2018-10-13 17:33:43 +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