AshClickhouse.Repo behaviour (AshClickhouse v0.1.0)

Copy Markdown View Source

Configuration module for AshClickhouse.

Define a repo in your application and add it to your supervision tree:

defmodule MyApp.Repo do
  use AshClickhouse.Repo, otp_app: :my_app
end

Then configure it in config/config.exs:

config :my_app, MyApp.Repo,
  url: "http://localhost:8123",
  database: "my_app_dev"

Options

  • :url — ClickHouse HTTP URL (default "http://localhost:8123")
  • :username / :password — credentials (default "default" / "")
  • :database — default database name
  • :pool_size — size of the connection pool (default 10)

Summary

Functions

Converts repo config to ClickHouse connection options.

Types

config()

@type config() :: keyword()

Callbacks

child_spec(keyword)

@callback child_spec(keyword()) :: Supervisor.child_spec()

config()

@callback config() :: keyword()

connection()

@callback connection() :: AshClickhouse.Connection.t() | nil

create_database(arg1)

@callback create_database(String.t() | nil) :: {:ok, term()} | {:error, term()}

database()

@callback database() :: String.t() | nil

drop_database(arg1)

@callback drop_database(String.t() | nil) :: {:ok, term()} | {:error, term()}

Functions

config_to_conn_opts(repo_module)

@spec config_to_conn_opts(module()) :: keyword()

Converts repo config to ClickHouse connection options.