ClickHouse/dbms/programs/odbc-bridge
2019-07-04 17:05:55 +03:00
..
tests Fix link in split mode (#4574) 2019-03-04 20:47:31 +03:00
CMakeLists.txt Add missing dependecies on sight to enable --no-undefined option 2019-07-04 17:05:55 +03:00
ColumnInfoHandler.cpp DEVTOOLS-5170 Delete Y_IGNORE markers (#5533) 2019-06-05 14:52:39 +03:00
ColumnInfoHandler.h
getIdentifierQuote.cpp DEVTOOLS-5170 Delete Y_IGNORE markers (#5533) 2019-06-05 14:52:39 +03:00
getIdentifierQuote.h DEVTOOLS-5170 Delete Y_IGNORE markers (#5533) 2019-06-05 14:52:39 +03:00
HandlerFactory.cpp Remove pocoext (#5036) 2019-04-17 20:36:58 +03:00
HandlerFactory.h
IdentifierQuoteHandler.cpp DEVTOOLS-5170 Delete Y_IGNORE markers (#5533) 2019-06-05 14:52:39 +03:00
IdentifierQuoteHandler.h
MainHandler.cpp Remove pocoext (#5036) 2019-04-17 20:36:58 +03:00
MainHandler.h
odbc-bridge.cpp
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 Use logging in clickhouse-local. Use config options in command line in clickhouse-client (#5540) 2019-06-14 17:00:37 +03:00
ODBCBridge.h
PingHandler.cpp
PingHandler.h
README.md
validateODBCConnectionString.cpp dbms: Fixed misspells in comments 2019-01-23 04:56:53 +09:00
validateODBCConnectionString.h

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