Fork me on GitHub
#xtdb
<
2022-12-11
>
tatut16:12:52

idk if there are any people using Erlang here, but I’ve been working on a library to use XTDB from Erlang (or other BEAM languages) https://github.com/tatut/xtdberl the main approach here is to map Erlang records to XTDB documents and query by providing “candidate record” to match.

👍 1
🆒 2
refset19:12:52

this is interesting! we've definitely had Elixir folks using XT before

refset19:12:55

I don't think I realised Jinterface was a thing :thinking_face: have you used it elsewhere previously?

tatut05:12:57

No, haven’t used jinterface before, as I am fairly new to Erlang… I wanted to use it so I can control serialization better and can hook erlang processes into tx listeners and stream results better

blob_thumbs_up 1
tatut05:12:23

I don’t really know elixir, but I’ve been meaning to try this with it as well, afaict the records are exactly the same as in erlang (tuples, with atom in 1st position denoting type)

tatut08:12:36

I was wrong, elixir structs seem to be maps like

#{'__struct__' => 'Elixir.Foo',age => 27,name => <<"John">>}
so not the same as erlang records

refset09:12:30

Ah, potentially a good time to remind ourselves that this Erlang HTTP client exists https://github.com/naomijub/translixir - not sure if that is useful to you, but maybe 🙂

tatut09:12:54

lgpl, so I won’t risk looking at it 😉

😄 1
tatut09:12:52

but I will look into elixir more, at some point,… it looks like I can fairly easily support the same mapping & query by candidate for elixir structs as erlang records

Ben Sless16:12:41

Why not use Clojerl? 🙃

tatut16:12:52

mainly because clojure has such a different programming model than erlang (which is pattern matching everywhere)