Process wrapper around the clickhouse client connection.
A connection is a named process that holds the configuration for a ClickHouse database. Queries are dispatched through this module so that the rest of the data layer does not need to know the details of the underlying client.
Options
:name— register the connection under this name (atom):url— the ClickHouse HTTP URL, e.g."http://localhost:8123":username/:password— credentials:database— the default database:otp_app— application to read config from (used byAshClickhouse.Repo)
The clickhouse client is started as a supervised GenServer. We keep a thin
wrapper so that the data layer can resolve a connection by name and run
queries with consistent error handling.
Summary
Functions
Returns the child spec for a connection (for supervision trees).
Returns the connection struct registered under name, if any.
Inserts rows into a table using the client's bulk insert helper.
Runs a SQL query against ClickHouse.
Runs a SQL query, raising on error.
Starts a ClickHouse connection as part of a supervision tree.
Stops the connection.
Types
Functions
@spec child_spec(keyword()) :: Supervisor.child_spec()
Returns the child spec for a connection (for supervision trees).
Returns the connection struct registered under name, if any.
Inserts rows into a table using the client's bulk insert helper.
Runs a SQL query against ClickHouse.
Returns {:ok, %ClickHouse.Result{}} or {:error, %ClickHouse.Error{}}.
Runs a SQL query, raising on error.
@spec start_link(keyword()) :: GenServer.on_start()
Starts a ClickHouse connection as part of a supervision tree.
Stops the connection.