ClickHouse (ClickHouse v0.19.1) View Source

A ClickHouse client.

This currently represents an early work in progress.

Link to this section Summary

Types

A ClickHouse client.

Various representations of ClickHouse-related errors.

Parameters used with queries.

A query statement.

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.

Creates a new query stream using a ClickHouse client.

Link to this section Types

Specs

client() :: atom() | ClickHouse.Client.t()

A ClickHouse client.

Specs

Various representations of ClickHouse-related errors.

Specs

params() :: list()

Parameters used with queries.

Specs

start_option() ::
  {:name, atom()}
  | {:interface, ClickHouse.Interface.t()}
  | {:formats, [ClickHouse.Format.t()]}

Options used for child_spec/1 and start_link/1

Specs

statement() :: binary() | struct()

A query statement.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

execute(client, query, opts \\ [])

View Source

Specs

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

Executes a query using a ClickHouse client.

Link to this function

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

View Source

Specs

prepare(client(), statement(), params()) :: ClickHouse.Query.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([start_option()]) :: Supervisor.on_start()

Starts a ClickHouse client.

Options

  • :name - The name of the client - defaults to :default.
  • :interface - The network 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.

Link to this function

stream!(client, query, params \\ [], opts \\ [])

View Source

Specs

stream!(client(), statement(), params(), opts :: keyword()) ::
  ClickHouse.Stream.t()

Creates a new query stream using a ClickHouse client.