ClickHouse.Interface behaviour (ClickHouse v0.17.1) View Source

A behaviour to implement a network interface with a ClickHouse server.

Link to this section Summary

Types

t()

The ClickHouse network interface.

Callbacks

A callback to execute a query with the network interface.

A callback to start the network interface.

A callback to stream the next query results with the network interface.

A callback to start a query result stream with the network interface.

Link to this section Types

Specs

t() :: module()

The ClickHouse network interface.

Link to this section Callbacks

Link to this callback

execute(client, query, opts)

View Source

Specs

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

A callback to execute a query with the network interface.

Specs

start_link(keyword()) :: GenServer.on_start()

A callback to start the network interface.

Link to this callback

stream_next(client, result_stream)

View Source

Specs

stream_next(
  client :: ClickHouse.Client.t(),
  result_stream :: ClickHouse.Stream.t()
) ::
  {:cont, ClickHouse.ResultStream.t()}
  | {:cont, ClickHouse.ResultStream.t(), ClickHouse.ResultStreamChunk.t()}
  | {:halt, ClickHouse.ResultStream.t()}
  | {:error, ClickHouse.error()}

A callback to stream the next query results with the network interface.

Link to this callback

stream_start(client, query, opts)

View Source

Specs

stream_start(
  client :: ClickHouse.Client.t(),
  query :: ClickHouse.Query.t(),
  opts :: keyword()
) :: {:ok, ClickHouse.ResultStream.t()} | {:error, ClickHouse.error()}

A callback to start a query result stream with the network interface.