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

Database.Bolty.Connection.Type

Description

Internal module. Not part of the public API.

Core types for Neo4j BOLT connections: configuration, errors, and connection handles.

Synopsis

Documentation

data Config Source #

Connection configuration. Use def for sensible defaults and override the fields you need. Must be validated with validateConfig before use.

Constructors

Config 

Fields

Instances

Instances details
Default Config Source # 
Instance details

Defined in Database.Bolty.Connection.Type

Methods

def :: Config #

data ValidatedConfig Source #

A validated configuration ready for connect. Created via validateConfig.

Constructors

ValidatedConfig 

Fields

data Connection Source #

An open connection to a Neo4j server. Obtain via connect.

Constructors

Connection 

Fields

data Error Source #

Errors that can occur during BOLT communication.

Constructors

TimeOut Text

A network operation timed out.

AuthentificationFailed

The server rejected the authentication credentials.

UnsupportedServerVersion Word32

No mutually supported BOLT version could be negotiated.

ResetFailed

A RESET message failed (connection is likely defunct).

CannotReadResponse Text

Failed to parse a response from the server.

NonboltyError SomeException

A non-BOLT exception (e.g. network IO error).

ResponseErrorRecords

Received records when a non-record response was expected.

WrongMessageFormat Text

The server sent an unexpected message type.

ResponseErrorIgnored

The server sent an IGNORED response.

ResponseErrorFailure Text Text

A FAILURE response with Neo4j error code and message.

InvalidState ServerState Text

Attempted an operation in an invalid server state.

RoutingTableError Text

Failed to fetch or parse a routing table.

data Scheme Source #

Authentication scheme for the HELLO handshake.

Constructors

None

No authentication.

Basic !Principal !Credentials

Basic username/password authentication.

Kerberos

Kerberos authentication (ticket obtained externally).

Bearer !Credentials

Bearer token authentication (e.g. SSO).

Instances

Instances details
Generic Scheme Source # 
Instance details

Defined in Database.Bolty.Connection.Type

Associated Types

type Rep Scheme 
Instance details

Defined in Database.Bolty.Connection.Type

type Rep Scheme = D1 ('MetaData "Scheme" "Database.Bolty.Connection.Type" "bolty-0.1.0.2-D4CzMg1BY3r5YzeDrGyWz4" 'False) ((C1 ('MetaCons "None" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Basic" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Principal) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Credentials))) :+: (C1 ('MetaCons "Kerberos" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Bearer" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Credentials))))

Methods

from :: Scheme -> Rep Scheme x #

to :: Rep Scheme x -> Scheme #

Eq Scheme Source # 
Instance details

Defined in Database.Bolty.Connection.Type

Methods

(==) :: Scheme -> Scheme -> Bool #

(/=) :: Scheme -> Scheme -> Bool #

PackStream Scheme Source # 
Instance details

Defined in Database.Bolty.Connection.Instances

Methods

toPs :: Scheme -> Ps #

toBinary :: Scheme -> Put #

fromPs :: Ps -> Result Scheme #

type Rep Scheme Source # 
Instance details

Defined in Database.Bolty.Connection.Type

type Rep Scheme = D1 ('MetaData "Scheme" "Database.Bolty.Connection.Type" "bolty-0.1.0.2-D4CzMg1BY3r5YzeDrGyWz4" 'False) ((C1 ('MetaCons "None" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Basic" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Principal) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Credentials))) :+: (C1 ('MetaCons "Kerberos" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Bearer" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Credentials))))

type Principal = Text Source #

Username for authentication.

type Credentials = Text Source #

Password or token for authentication.

data Routing Source #

Routing mode for cluster-aware connections.

Constructors

NoRouting

Direct connection (no routing).

Routing

Use server-side routing with default settings.

RoutingSpec !Text !(HashMap Text Text)

Use server-side routing with explicit address and parameters. Arguments: advertised address (e.g. "core1:7687"), additional routing context parameters.

Instances

Instances details
Eq Routing Source # 
Instance details

Defined in Database.Bolty.Connection.Type

Methods

(==) :: Routing -> Routing -> Bool #

(/=) :: Routing -> Routing -> Bool #

PackStream Routing Source # 
Instance details

Defined in Database.Bolty.Connection.Instances

data UserAgent Source #

User-agent identifier sent to the server in the HELLO message.

Constructors

UserAgent 

Fields

Instances

Instances details
Eq UserAgent Source # 
Instance details

Defined in Database.Bolty.Connection.Type

PackStream UserAgent Source # 
Instance details

Defined in Database.Bolty.Connection.Instances

isTransient :: Error -> Bool Source #

Check if an error is a transient Neo4j failure that can be retried.

isRoutingError :: Error -> Bool Source #

Check if an error indicates stale routing information. These errors mean the driver sent a request to the wrong server (e.g. a write to a read replica). The routing table should be invalidated and the operation retried on a fresh leader.