ClickHouse/dbms/programs/odbc-bridge
Denis Glazachev 8e48430159 Add handling of SQL_TINYINT and SQL_BIGINT
Fix handling of SQL_FLOAT
2019-10-25 21:49:49 +04:00
..
tests
CMakeLists.txt Merge remote-tracking branch 'upstream/master' into issue-6459 2019-09-20 21:25:55 +03:00
ColumnInfoHandler.cpp Add handling of SQL_TINYINT and SQL_BIGINT 2019-10-25 21:49:49 +04:00
ColumnInfoHandler.h
getIdentifierQuote.cpp
getIdentifierQuote.h
HandlerFactory.cpp
HandlerFactory.h
IdentifierQuoteHandler.cpp
IdentifierQuoteHandler.h
MainHandler.cpp Remove TSKVRowInputStream. 2019-08-02 19:58:52 +03:00
MainHandler.h
odbc-bridge.cpp
ODBCBlockInputStream.cpp Added "assert_cast" function as a replacement for static_cast for columns 2019-08-21 05:28:04 +03:00
ODBCBlockInputStream.h adding -Wshadow for GCC 2019-08-09 23:58:16 +03:00
ODBCBridge.cpp Make SensitiveDataMasker a singleton. (#6810) 2019-09-06 20:48:27 +03:00
ODBCBridge.h
PingHandler.cpp
PingHandler.h
README.md
validateODBCConnectionString.cpp
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