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

Using keyspace breaks CQEx #29

Open
jvf opened this issue Sep 28, 2017 · 0 comments
Open

Using keyspace breaks CQEx #29

jvf opened this issue Sep 28, 2017 · 0 comments
Labels

Comments

@jvf
Copy link

jvf commented Sep 28, 2017

There seems to be a bug in CQEx.Result.convert/2, the case of setting the keyspace seems not to be handled:

Calling

stmt = """
CREATE KEYSPACE foo 
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3}
"""
Query.call(client, stmt)
Query.call(client, "USE foo")

fails with

** (FunctionClauseError) no function clause matching in CQEx.Result.convert/2

    The following arguments were given to CQEx.Result.convert/2:

        # 1
        {:set_keyspace, "foo"}

        # 2
        {#PID<0.474.0>, #Reference<0.2977995123.3760455683.197727>}

    Attempted function clauses (showing 3 out of 3):

        def convert(r, _client) when is_atom(:cql_result) and is_tuple(r) and tuple_size(r) > 0 and :erlang.element(1, r) == :cql_result
        def convert(q, client) when is_atom(:cql_schema_changed) and is_tuple(q) and tuple_size(q) > 0 and :erlang.element(1, q) == :cql_schema_changed
        def convert(:void, client)

    (cqex) lib/cqex/result.ex:35: CQEx.Result.convert/2
    (cqex) lib/cqex/query.ex:66: CQEx.Query.call/2

Calling

    {:ok, {:set_keyspace, "foo"}} = :cqerl.run_query(client, "USE foo")

directly works.

@matehat matehat added the bug label Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants