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 |
Replies: 5 comments 5 replies
|
@batok please provide a repository that I can clone that demonstrates what you have tried. |
|
FWIW I see this here also,
the mix-fetched khepri compiles just fine outside mix with rebar3, still digging into |
|
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 |
|
As there's a |
# 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], "foobar@gmail.com")
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 |
The issue is that khepri is published to hex source-only, but does not include a
mix.exsfile for compiling it. So, when it's a dependency of an elixir project,mixdoesn't know how to build it. You can see what kind of projectmixdetects it as here: