bolty-0.1.0.2: Haskell driver for Neo4j (BOLT protocol 4.4-5.4)
Safe HaskellNone
LanguageGHC2021

Database.Bolty.Message.Response

Description

Internal module. Not part of the public API.

Synopsis

Documentation

data Response Source #

A BOLT server response message.

the server always responds with one summary message if the connection is still open the server always responds with zero or more detail messages before sending a summary message

Instances

Instances details
PackStream Response Source # 
Instance details

Defined in Database.Bolty.Message.Response

data Failure Source #

A server-reported failure with a Neo4j error code and human-readable message.

Constructors

Failure 

Fields

Instances

Instances details
PackStream Failure Source # 
Instance details

Defined in Database.Bolty.Message.Response

data SuccessHello Source #

Parsed HELLO SUCCESS metadata.

Constructors

SuccessHello 

Fields

  • server :: !Text

    server agent string, example "Neo4j/4.1.0"

  • connection_id :: !Text

    unique identifier of the bolt connection used on the server side, example: "bolt-61"

  • hints :: !(HashMap Text Ps)

    set of optional configuration hints to be considered by the driver

data SuccessRun Source #

Parsed RUN SUCCESS metadata, either auto-commit or explicit transaction.

successFields :: SuccessRun -> Vector Text Source #

Extract the result field names from a SuccessRun.

successTFirst :: SuccessRun -> Int64 Source #

Extract the t_first timing value from a SuccessRun.

data SuccessRunAutoCommitTransaction Source #

RUN SUCCESS metadata for an auto-commit transaction.

Constructors

SuccessRunAutoCommitTransaction 

Fields

  • fields :: !(Vector Text)

    the fields of the return result. e.g. [“name”, “age”, …]

  • t_first :: !Int64

    the time, specified in ms, which the first record in the result stream is available after

data SuccessRunExplicitTransaction Source #

RUN SUCCESS metadata for an explicit transaction.

Constructors

SuccessRunExplicitTransaction 

Fields

  • fields :: !(Vector Text)

    the fields of the return result. e.g. [“name”, “age”, …]

  • t_first :: !Int64

    the time, specified in ms, which the first record in the result stream is available after

  • qid :: !Int64

    specifies the server assigned statement ID to reference the server side result-set with commencing BEGIN+RUN+PULL and BEGIN+RUN+DISCARD messages.

makeResponseRunAutoCommitTransaction :: HashMap Text Ps -> Either Text SuccessRun Source #

Parse a RUN SUCCESS response for an auto-commit transaction.

data SuccessDiscard Source #

Parsed DISCARD SUCCESS response.

data SuccessDiscardLast Source #

Final DISCARD SUCCESS metadata with bookmark and database.

Constructors

SuccessDiscardLast 

Fields

  • bookmark :: !Text

    the bookmark after committing this transaction (Auto-commit Transaction only)

  • db :: !Text

    the database name where the query is executed.

data SuccessPull Source #

Full query result: records plus server metadata.

Constructors

SuccessPull 

Fields

data QueryMeta Source #

Server metadata from a PULL SUCCESS response.

Constructors

QueryMeta 

Fields

  • bookmark :: !(Maybe Text)

    the bookmark after committing this transaction (Autocommit Transaction only, absent in explicit transactions).

  • t_last :: !Int64

    the time, specified in ms, which the last record in the result stream is consumed after.

  • type_ :: !Text

    the type of the statement, e.g. "r" for read-only statement, "w" for write-only statement, "rw" for read-and-write, and "s" for schema only.

  • stats :: !(Maybe Ps)

    counter information, such as db-hits etc. May be omitted.

  • parsedStats :: !(Maybe QueryStats)

    parsed stats from the raw field above.

  • plan :: !(Maybe Ps)

    plan result. May be omitted.

  • profile :: !(Maybe Ps)

    profile result. May be omitted.

  • notifications :: !(Maybe Ps)

    a list of all notifications generated during execution of this statement. May be omitted.

  • parsedNotifications :: !(Vector Notification)

    parsed notifications from the raw field above.

  • parsedPlan :: !(Maybe PlanNode)

    parsed plan tree from the raw plan field above.

  • parsedProfile :: !(Maybe ProfileNode)

    parsed profile tree from the raw profile field above.

  • db :: !Text

    the database name where the query was executed (v4.0+).

makeSuccessPull :: Vector Record -> HashMap Text Ps -> Either Text SuccessPull Source #

Build a SuccessPull from collected records and PULL SUCCESS metadata (Either version).

mapToSuccessPull :: Vector Record -> HashMap Text Ps -> Result SuccessPull Source #

Build a SuccessPull from collected records and PULL SUCCESS metadata (Result version).

data SuccessCommit Source #

Parsed COMMIT SUCCESS metadata.

Constructors

SuccessCommit 

Fields

  • bookmark :: !Text

    the bookmark after committing this transaction.

data RoutingTable Source #

A parsed routing table returned by the ROUTE message.

Constructors

RoutingTable 

Fields

  • ttl :: !Int64

    Seconds to cache this routing table.

  • db :: !Text

    Database name this routing table is for.

  • routers :: !(Vector Text)

    "host:port" addresses for ROUTE role.

  • readers :: !(Vector Text)

    "host:port" addresses for READ role.

  • writers :: !(Vector Text)

    "host:port" addresses for WRITE role.

parseRoutingTable :: HashMap Text Ps -> Either Text RoutingTable Source #

Parse a routing table from the SUCCESS response metadata of a ROUTE message. The expected wire format is: {"rt": {"ttl": N, "db": "name", "servers": [{"addresses": [...], "role": WRITE}, ...]}}

extractBookmark :: HashMap Text Ps -> Maybe Text Source #

Extract the bookmark from a SUCCESS response metadata (e.g. from COMMIT). Returns Nothing if the bookmark key is absent or not a text value.