API
Types
ClickHouse.ClickHouseServerException — Type
An error reported by the ClickHouse server. Its fields are an integer code and strings name and message.
ClickHouse.ClickHouseSock — Type
A connection to a ClickHouse server using the native TCP protocol. Create a connection with connect, release it with close, and reconnect a closed socket with connect!.
Functions
ClickHouse.connect — Function
connect(host = "localhost", port = 9000;
database = "",
username = "default",
password = "",
connection_timeout = DBMS_DEFAULT_CONNECT_TIMEOUT,
max_insert_block_size = DBMS_DEFAULT_MAX_INSERT_BLOCK,
send_buffer_size = DBMS_DEFAULT_BUFFER_SIZE,
compression = COMPRESSION_NONE)
Return ClickHouseSock connected to ClickHouse server with the specified parameters. The endpoint must use unencrypted native TCP; HTTPS and TLS are not supported. compression selects the format of outgoing data blocks and enables compressed replies when it is not COMPRESSION_NONE. The server chooses the reply format; the client reads it from each block's header.
ClickHouse.connect! — Function
connect!(sock::ClickHouseSock; force = false)Connects sock to ClickHouse server using connection settings from sock.settings If force = false and sock already connected then existing connection is used If force = true then sock then the socket is closed and a new connection is created
ClickHouse.execute — Function
Execute a DDL query.
ClickHouse.insert — Function
Insert blocks into a table, reading from an iterable. Each block maps Symbol column names to arrays through keys and pairs, for example a Dict or NamedTuple. All columns must have the same length. Returns once the server confirms completion; progress updates do not interrupt the insert.
ClickHouse.ping — Function
Send a ping request and wait for the response.
ClickHouse.select — Function
Execute a query, flattening blocks into a single dict of column arrays.
ClickHouse.select_channel — Function
Execute a query, streaming the resulting blocks through a channel.
ClickHouse.select_df — Function
Execute a query, flattening blocks into a dataframe.
ClickHouse.select_callback — Function
Execute a query, invoking a callback for each block.