Has anybody testing khepri with elixir? #25
-
Hi, I have tried to use khepri as shown in README.md , but having errors from a mix project and from a script using Mix.install/1 |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 5 replies
-
@batok please provide a repository that I can clone that demonstrates what you have tried. |
Beta Was this translation helpful? Give feedback.
-
FWIW I see this here also,
the mix-fetched khepri compiles just fine outside mix with rebar3, still digging into |
Beta Was this translation helpful? Give feedback.
-
The issue is that khepri is published to hex source-only, but does not include a
The workaround is to use the https://github.com/lukebakken/khepri_test/blob/main/mix.exs#L24 We'll fix this issue by including a I tested my project using Erlang 24.2, Elixir 1.13.1 on Windows 10 |
Beta Was this translation helpful? Give feedback.
-
As there's a |
Beta Was this translation helpful? Give feedback.
-
# requires at least elixir 1.12
#Mix.install([{:khepri, "~> 0.1", manager: :rebar3}])
Mix.install([{:khepri, github: "rabbitmq/khepri"}])
defmodule Main do
def start() do
:khepri.start()
val = :khepri.insert([:emails, :me], "[email protected]")
IO.puts "after insert"
inspect val
val = :khepri.get([:emails, :me])
IO.puts "after get"
inspect val
end
end
Main.start() If you save this to script.exs and run elixir script.exs you'll see it works initializing stuff but has to return values from khepri:get/1 and khepri:insert/2 |
Beta Was this translation helpful? Give feedback.
The issue is that khepri is published to hex source-only, but does not include a
mix.exs
file for compiling it. So, when it's a dependency of an elixir project,mix
doesn't know how to build it. You can see what kind of projectmix
detects it as here: