ClickHouse (ClickHouse v0.10.0) View Source

A ClickHouse client.

This currently represents an early work in progress.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Executes a query using a ClickHouse client.

Prepares a query for a ClickHouse client.

Prepares and executes a query using a ClickHouse client.

Starts a ClickHouse client.

Link to this section Types

Specs

client() :: atom()

Specs

Specs

format() :: module()

Specs

interface() :: module()

Specs

option() ::
  {:client, client()} | {:interface, interface()} | {:interface_opts, keyword()}

Specs

options() :: [option()]

Specs

params() :: list()

Specs

statement() :: binary()

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

execute(ClickHouse.Query.t()) ::
  {:ok, ClickHouse.Result.t()} | {:error, error()}

Executes a query using a ClickHouse client.

Link to this function

prepare(client, statement, params \\ [], opts \\ [])

View Source

Specs

prepare(client(), statement(), params(), keyword()) ::
  {:ok, ClickHouse.Query.t()} | {:error, ClickHouse.FormatError.t()}

Prepares a query for a ClickHouse client.

Link to this function

query(client, statement, params \\ [], opts \\ [])

View Source

Specs

query(client(), statement(), params(), keyword()) ::
  {:ok, ClickHouse.Result.t()} | {:error, error()}

Prepares and executes a query using a ClickHouse client.

Specs

start_link(options()) :: Supervisor.on_start()

Starts a ClickHouse client.

Options

  • :client - The name of the client - defaults to :default.
  • :interface - The interface to use for queries - defaults to ClickHouse.Interface.HTTP.
  • :formats - A list of formats available for encoding/decoding.

Extra Options

Any additional options passed will be given to the client interface.