ex_cypher v0.2.0 ExCypher.Buffer

In order to preserve the generated query without conflicts about where the code is being ran, this module implements a small buffer using an Agent that keeps a list of all statements that could be parsed.

This way, every time one invokes the cypher macro, a new agent is started, and every line inside is parsed. Those commands that can be converted into a Cypher command are then parsed and pushed into the agent.

At the end, the ExCypher.Buffer.generate_query/1 function can be called and all lines are joined to build the correct query string.

But remember that this module shouldn't be used directly by your code!

Link to this section Summary

Link to this section Functions

Link to this function

generate_query(buffer)

generate_query(buffer :: pid()) :: String.t()
Link to this function

new_query()

new_query() :: {:ok, pid()} | {:error, term()}
Link to this function

put_buffer(buffer, elements)

put_buffer(buffer :: pid(), elements :: term()) :: :ok | {:error, term()}
Link to this function

stop_buffer(buffer)

stop_buffer(buffer :: pid()) :: :ok | {:error, term()}