Bolt.Sips v2.0.5 Bolt.Sips.Internals.BoltProtocolV3 View Source
Link to this section Summary
Functions
Implementation of Bolt's BEGIN. It opens a transaction.
Implementation of Bolt's COMMIT. It commits the open transaction.
Implementation of Bolt's RUN. It closes the connection.
Implementation of Bolt's HELLO. It initialises the connection.
Implementation of Bolt's ROLLBACK. It rollbacks the open transaction.
Implementation of Bolt's RUN. It passes a statement for execution on the server.
Runs a statement (most likely Cypher statement) and returns a list of the records and a summary (Act as as a RUN + PULL_ALL).
Link to this section Functions
Implementation of Bolt's BEGIN. It opens a transaction.
Options
See "Shared options" in Bolt.Sips.Internals.BoltProtocolHelper
documentation.
Example
iex> BoltProtocolV3.begin(:gen_tcp, port, 3, [])
{:ok, metadata}
Implementation of Bolt's COMMIT. It commits the open transaction.
Options
See "Shared options" in Bolt.Sips.Internals.BoltProtocolHelper
documentation.
Example
iex> BoltProtocolV3.commit(:gen_tcp, port, 3, [])
:ok
Implementation of Bolt's RUN. It closes the connection.
Options
See "Shared options" in Bolt.Sips.Internals.BoltProtocolHelper
documentation.
Examples
iex> Bolt.Sips.Internals.BoltProtocolV3.goodbye(:gen_tcp, port, 3)
:ok
iex> Bolt.Sips.Internals.BoltProtocolV3.goodbye(:gen_tcp, port, 3)
:ok
hello(transport, port, bolt_version, auth, options \\ [recv_timeout: 15000])
View SourceImplementation of Bolt's HELLO. It initialises the connection.
Expects a transport module (i.e. gen_tcp
) and a Port
. Accepts
authorisation params in the form of {username, password}.
Options
See "Shared options" in Bolt.Sips.Internals.BoltProtocolHelper
documentation.
Examples
iex> Bolt.Sips.Internals.BoltProtocolV3.hello(:gen_tcp, port, 3, {}, [])
{:ok, info}
iex> Bolt.Sips.Internals.BoltProtocolV3.hello(:gen_tcp, port, 3, {"username", "password"}, [])
{:ok, info}
Implementation of Bolt's ROLLBACK. It rollbacks the open transaction.
Options
See "Shared options" in Bolt.Sips.Internals.BoltProtocolHelper
documentation.
Example
iex> BoltProtocolV3.rollback(:gen_tcp, port, 3, [])
:ok
run(transport, port, bolt_version, statement, params, metadata, options)
View SourceImplementation of Bolt's RUN. It passes a statement for execution on the server.
Note that this message doesn't return the statement result. For this purpose, use PULL_ALL. In bolt >= 3, run has an additional paramters; metadata
Options
See "Shared options" in Bolt.Sips.Internals.BoltProtocolHelper
documentation.
Example
iex> BoltProtocolV1.run(:gen_tcp, port, 1, "RETURN {num} AS num", %{num: 5}, %{}, [])
{:ok, {:success, %{"fields" => ["num"]}}}
run_statement(transport, port, bolt_version, statement, params, metadata, options)
View SourceRuns a statement (most likely Cypher statement) and returns a list of the records and a summary (Act as as a RUN + PULL_ALL).
Records are represented using PackStream's record data type. Their Elixir
representation is a Keyword with the indexes :sig
and :fields
.
Options
See "Shared options" in Bolt.Sips.Internals.BoltProtocolHelper
documentation.
Examples
iex> Bolt.Sips.Internals.BoltProtocol.run_statement(:gen_tcp, port, 1, "MATCH (n) RETURN n")
[
{:success, %{"fields" => ["n"]}},
{:record, [sig: 1, fields: [1, "Example", "Labels", %{"some_attribute" => "some_value"}]]},
{:success, %{"type" => "r"}}
]