View Source Ecto.Adapters.Druid (ecto_druid v0.5.0)

This adapter allows you to use Druid as a database with Ecto.

Installation

To use the Druid adapter, you need to add it to your mix.exs file:

defp deps do
  [
    {:ecto_druid, "~> 0.3.0"}
  ]
end

Usage

You can now use Ecto with Druid by defining a repository that uses the Druid adapter:

defmodule MyApp.Repo do
  use Ecto.Repo,
    otp_app: :my_app,
    adapter: Ecto.Adapters.Druid
end

Configuration

Then you need to configure your repository to use the Druid adapter:

config :my_app, MyApp.Repo,
  host: "localhost",
  port: 8082
  finch_opts: [pools: %{default: [size: 10]}]

The following options are supported:

  • :host - The host of the Druid server.
  • :port - The port of the Druid server.
  • :scheme - The scheme of the Druid server (http or https).
  • :finch_opts - Options to pass to Finch when making requests to Druid.