Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fun substituted for the QLC is not compiled #3

Closed
nitinjain1105 opened this issue Dec 11, 2018 · 3 comments
Closed

fun substituted for the QLC is not compiled #3

nitinjain1105 opened this issue Dec 11, 2018 · 3 comments

Comments

@nitinjain1105
Copy link

Hi There,

I am trying to use the following:

list = [["a",1],["b",2]]
Qlc.q("[X || X = [K,V] <- L, K =/= Item]", L: list, Item: "b")

Issue is that I want to substitute this whole thing with a variable and it is not working, can you please help:

list = [["a",1],["b",2]]
test_variable = "[X || X = [K,V] <- L, K =/= Item]", L: list, Item: "b"
Qlc.q(test_variable)

@k1complete
Copy link
Owner

Hi, thanks this report.
It is limitation from base erlang:qlc module.
Any query string must be literal (determinated at compile time).
But, binding list may be variable.

list = [["a",1],["b",2]]
test_param = [L: list, Item: "b"]
Qlc.q("[X || X = [K,V] <- L, K =/= Item]", test_param)

@k1complete
Copy link
Owner

I try fix this problem.
version 1.0.2 now available.
Qlc.q/3 can treat variable.
work it.

list = [["a",1],["b",2]]
test_param = [L: list, Item: "b"]
test_query = "[X || X = [K,V] <- L, K =/= Item]"
Qlc.q(test_query, test_param) |> Qlc.e()

@nitinjain1105
Copy link
Author

Thank you @k1complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants