Neodriver_eio.BoltBolt protocol messages (send/receive and response interpretation).
Bolt protocol messages: PackStream structures tagged by message type.
See bolt.ml for the implementation.
val send :
Transport.t ->
tag:int ->
Neodriver_packstream.Packstream.value list ->
(unit, Neodriver_core.Errors.t) Stdlib.resultPack a message with the given tag and fields and send it.
val recv :
Transport.t ->
(int * Neodriver_packstream.Packstream.value option, Neodriver_core.Errors.t)
Stdlib.resultRead one message and return its (tag, payload), where payload is the message's single field (none if the message carries no fields).
val recv_fields :
Transport.t ->
(int * Neodriver_packstream.Packstream.value list, Neodriver_core.Errors.t)
Stdlib.resultRead one message and return its (tag, fields). For a RECORD the fields are the record's values.
val respond :
Transport.t ->
(Neodriver_packstream.Packstream.value, Neodriver_core.Errors.t)
Stdlib.resultRead a response message and interpret it: SUCCESS metadata is returned as Ok _; a FAILURE is mapped to Error (Neo4j _) via its code and message; an IGNORED (or any other tag) is an error.
val hello :
Transport.t ->
headers:Neodriver_packstream.Packstream.value ->
(Neodriver_packstream.Packstream.value, Neodriver_core.Errors.t)
Stdlib.resultSend a HELLO message with headers and read the response.
val logon :
Transport.t ->
auth:Neodriver_packstream.Packstream.value ->
(Neodriver_packstream.Packstream.value, Neodriver_core.Errors.t)
Stdlib.resultSend a LOGON message with the authentication map auth and read the response.
val logoff :
Transport.t ->
(Neodriver_packstream.Packstream.value, Neodriver_core.Errors.t)
Stdlib.resultSend a LOGOFF message and read the response.
val run :
Transport.t ->
query:string ->
parameters:Neodriver_packstream.Packstream.value ->
extra:Neodriver_packstream.Packstream.value ->
(Neodriver_packstream.Packstream.value, Neodriver_core.Errors.t)
Stdlib.resultSend a RUN message for query with the given parameters and extra map, and read the response.
val begin_ :
Transport.t ->
extra:Neodriver_packstream.Packstream.value ->
(Neodriver_packstream.Packstream.value, Neodriver_core.Errors.t)
Stdlib.resultSend a BEGIN message with the extra map (mode, db, bookmarks, tx_metadata, tx_timeout) and read the response.
val commit :
Transport.t ->
(Neodriver_packstream.Packstream.value, Neodriver_core.Errors.t)
Stdlib.resultSend a COMMIT message and read the response (its metadata carries the bookmark).
val rollback :
Transport.t ->
(Neodriver_packstream.Packstream.value, Neodriver_core.Errors.t)
Stdlib.resultSend a ROLLBACK message and read the response.
val pull :
Transport.t ->
extra:Neodriver_packstream.Packstream.value ->
(Neodriver_packstream.Packstream.value list list
* (Neodriver_packstream.Packstream.value, Neodriver_core.Errors.t)
Stdlib.result,
Neodriver_core.Errors.t)
Stdlib.resultSend a PULL message with the extra map (e.g. n, qid) and read the result: all RECORD messages up to the terminal message. Returns the records delivered so far and the terminal outcome — Ok summary on SUCCESS, Error _ on a server FAILURE/IGNORED (the records delivered before the failure are kept, so a mid-stream error can be surfaced after buffering).
val discard :
Transport.t ->
extra:Neodriver_packstream.Packstream.value ->
(Neodriver_packstream.Packstream.value list list
* (Neodriver_packstream.Packstream.value, Neodriver_core.Errors.t)
Stdlib.result,
Neodriver_core.Errors.t)
Stdlib.resultSend a DISCARD message with the extra map and read the result (same shape as pull, though records are normally empty).
val metadata_has_more : Neodriver_packstream.Packstream.value -> boolWhether a summary metadata map carries has_more = true.