is there a way to use qlc from elixir?

372 views
Skip to first unread message

Alex Shneyderman

unread,
Nov 7, 2014, 11:59:33 AM11/7/14
to elixir-l...@googlegroups.com
i am trying to figure how to use mnesia from elixir. Some things are pretty straight-forward others are not so but use of qlc seems like a must if you ever want to order things by other than IDs in the ordered set. qlc is heavy on use of the parse transforms. so its direct use within elixir is not possible (or is it?). 

1. Is there an alternative to qlc in elixir land? 
2. If not is there a way to mix erlang and elixir code in the same elixir project (i'd rather have qlc dependent erlang code in my elixir lib)? 

cheers,
alex.

José Valim

unread,
Nov 7, 2014, 12:05:20 PM11/7/14
to elixir-l...@googlegroups.com
I think qlc is a parse transform, so it can be included by passing the parse transform to the @compile attribute.

Otherwise, you can just drop .erl files in the src/ directory and mix will compile them for you.
--
You received this message because you are subscribed to the Google Groups "elixir-lang-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-ta...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--


José Valim
Skype: jv.ptec
Founder and Lead Developer

Saša Jurić

unread,
Nov 7, 2014, 12:19:11 PM11/7/14
to elixir-l...@googlegroups.com, jose....@plataformatec.com.br


On Friday, November 7, 2014 6:05:20 PM UTC+1, José Valim wrote:
I think qlc is a parse transform, so it can be included by passing the parse transform to the @compile attribute.

That's true, however qlc operates on Erlang list comprehensions, and I don't think there's a way to generate those from Elixir. So I think the only approach is to implement those queries in a pure Erlang file which is a part of the Mix project.

T Ty

unread,
Nov 7, 2014, 12:31:58 PM11/7/14
to elixir-l...@googlegroups.com
Or use Amnesia. 

--
Reply all
Reply to author
Forward
0 new messages