clickhousex v0.5.0 Clickhousex.Codec behaviour View Source

Behaviour for input and/or output format.

If none of the out of the box codecs suits your needs, you can implement one of the supported ones yourself.

Link to this section Summary

Link to this section Types

Specs

select_response() :: %{
  column_names: [String.t()],
  rows: [tuple()],
  row_count: non_neg_integer()
}

Specs

state() :: any()

Link to this section Callbacks

Specs

append(state(), iodata()) :: state()

Specs

decode(state()) :: {:ok, select_response()} | {:error, any()}
Link to this callback

encode(query, param_replacements, params)

View Source

Specs

encode(
  query :: Clickhousex.Query.t(),
  param_replacements :: iodata(),
  params :: [any()]
) :: iodata()

Specs

new() :: state()

Specs

request_format() :: String.t()

Specs

response_format() :: String.t()