View Source Ecto.Adapters.ClickHouse (Ecto ClickHouse v0.3.9)

Adapter module for ClickHouse.

It uses Ch for communicating to the database.

Options

All options can be given via the repository configuration:

config :your_app, YourApp.Repo,
  ...
  • :hostname - Server hostname (default: "localhost")
  • :username - Username
  • :password - User password
  • :port - HTTP Server port (default: 8123)
  • :scheme - HTTP scheme (default: "http")
  • :database - the database to connect to (default: "default")
  • :settings - Keyword list of connection settings
  • :transport_opts - Options to be given to the transport being used. See Mint.HTTP1.connect/4 for more info

Summary

Functions

Converts the given query to SQL according to its kind and inlines all parameters. Useful for debugging.

Functions

Link to this function

delete(adapter_meta, schema_meta, params, opts)

View Source
Link to this function

to_inline_sql(operation, queryable)

View Source
@spec to_inline_sql(:all | :delete_all | :update_all, Ecto.Queryable.t()) ::
  String.t()

Converts the given query to SQL according to its kind and inlines all parameters. Useful for debugging.

Example:

iex> query = from n in fragment("numbers(10)"), where: n.number == ^-1, select: n.number
iex> Ecto.Adapters.ClickHouse.to_inline_sql(:all, query)
~s{SELECT f0."number" FROM numbers(10) AS f0 WHERE (f0."number" = -1)}

Compare it with the output of to_sql/2

iex> query = from n in fragment("numbers(10)"), where: n.number == ^-1, select: n.number
iex> Ecto.Adapters.ClickHouse.to_sql(:all, query)
{~s[SELECT f0."number" FROM numbers(10) AS f0 WHERE (f0."number" = {$0:Int64})], [-1]}