Documentation
¶
Index ¶
- Constants
- type ErrorClassification
- type FeatureNotSupportedError
- type GqlStatusObject
- type InputPosition
- type Neo4jError
- func (e *Neo4jError) Category() string
- func (e *Neo4jError) Classification() string
- func (e *Neo4jError) Error() string
- func (e *Neo4jError) HasSecurityCode() bool
- func (e *Neo4jError) IsAuthenticationFailed() bool
- func (e *Neo4jError) IsRetriable() bool
- func (e *Neo4jError) IsRetriableCluster() bool
- func (e *Neo4jError) IsRetriableTransient() bool
- func (e *Neo4jError) MarkRetriable()
- func (e *Neo4jError) Title() string
- type Notification
- type Plan
- type ProfiledPlan
- type ProtocolError
- type ProtocolVersion
- type Record
- type StatementType
- type StreamSummary
- type Summary
- type UnsupportedTypeError
Examples ¶
Constants ¶
const ( NodesCreated = "nodes-created" NodesDeleted = "nodes-deleted" RelationshipsCreated = "relationships-created" RelationshipsDeleted = "relationships-deleted" PropertiesSet = "properties-set" LabelsAdded = "labels-added" LabelsRemoved = "labels-removed" IndexesAdded = "indexes-added" IndexesRemoved = "indexes-removed" ConstraintsAdded = "constraints-added" ConstraintsRemoved = "constraints-removed" SystemUpdates = "system-updates" )
Counter key names
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorClassification ¶
type ErrorClassification string
const ( ClientError ErrorClassification = "CLIENT_ERROR" DatabaseError ErrorClassification = "DATABASE_ERROR" TransientError ErrorClassification = "TRANSIENT_ERROR" UnknownError ErrorClassification = "UNKNOWN" )
type FeatureNotSupportedError ¶
func (*FeatureNotSupportedError) Error ¶
func (e *FeatureNotSupportedError) Error() string
type GqlStatusObject ¶
type GqlStatusObject struct { // Deprecated: for backward compatibility with Notification.Code only. Code string // Deprecated: for backward compatibility with Notification.Title only. Title string // Deprecated: for backward compatibility with Notification.Description only. Description string // GqlStatus returns the GQLSTATUS. // The following GQLSTATUS codes denote codes that the driver will use for // polyfilling (when connected to an old, non-GQL-aware server). Further, they may be used by servers // during the transition-phase to GQLSTATUS-awareness. // - "01N42" (warning - unknown warning) // - "02N42" (no data - unknown subcondition) // - "03N42" (informational - unknown notification) // - "05N42" (general processing exception - unknown error) // // This means these codes are not guaranteed to be stable and may change in future versions. GqlStatus string // StatusDescription returns a description of the status. StatusDescription string // Position returns the position in the statement where this status points to. // Not all statuses have a unique position to point to and in that case the position would be set to nil. // // Only Notifications (see IsNotification) have a meaningful position. Position *InputPosition // Classification returns the mapped Classification of this status. // If the Classification is not a known value, Classification returns notifications.UnknownClassification. // // Only Notifications (see IsNotification) have a meaningful classification. Classification string // Severity returns the mapped Severity of this status. // If the Severity is not a known value, Severity returns notifications.UnknownSeverity. // // Only Notifications (see IsNotification) have a meaningful severity. Severity string // DiagnosticRecord returns further information about the status for diagnostic purposes. DiagnosticRecord map[string]any // IsNotification returns true if this status is a Notification. // // Only some statuses are Notifications. IsNotification bool }
GqlStatusObject represents a GqlStatusObject generated when executing a statement. A GqlStatusObject can be visualized in a client pinpointing problems or other information about the statement. Contrary to failures or errors, GqlStatusObjects do not affect the execution of the statement.
GqlStatusObject is part of the GQL compliant notifications preview feature (see README on what it means in terms of support and compatibility guarantees)
type InputPosition ¶
type InputPosition struct { // Offset contains the character offset referred to by this position; offset numbers start at 0. Offset int // Line contains the line number referred to by this position; line numbers start at 1. Line int // Column contains the column number referred to by this position; column numbers start at 1. Column int }
InputPosition contains information about a specific position in a statement
type Neo4jError ¶
type Neo4jError struct { // Code is the Neo4j-specific error code, to be deprecated in favor of GqlStatus. Code string // Msg is the specific error message describing the failure. Msg string // GqlStatus returns the GQLSTATUS. // GqlStatus is the error code compliant with the GQL specification. // // GqlStatus is part of the GQL compliant errors preview feature // (see README on what it means in terms of support and compatibility guarantees) GqlStatus string // GqlStatusDescription provides a standard description for the associated GQLStatus code. // // GqlStatusDescription is part of the GQL compliant errors preview feature // (see README on what it means in terms of support and compatibility guarantees) GqlStatusDescription string // GqlClassification is a high-level categorization of the error, specific to GQL error handling. // // GqlClassification is part of the GQL compliant errors preview feature // (see README on what it means in terms of support and compatibility guarantees) GqlClassification ErrorClassification // GqlRawClassification holds the raw classification as received from the server. // // GqlRawClassification is part of the GQL compliant errors preview feature // (see README on what it means in terms of support and compatibility guarantees) GqlRawClassification string // GqlDiagnosticRecord returns further information about the status for diagnostic purposes. // // GqlDiagnosticRecord is part of the GQL compliant errors preview feature // (see README on what it means in terms of support and compatibility guarantees) GqlDiagnosticRecord map[string]any // GqlCause represents the underlying error, if any, which caused the current error. // // GqlCause is part of the GQL compliant errors preview feature // (see README on what it means in terms of support and compatibility guarantees) GqlCause *Neo4jError // contains filtered or unexported fields }
Neo4jError is created when the database server fails to fulfill a request.
func (*Neo4jError) Category ¶
func (e *Neo4jError) Category() string
func (*Neo4jError) Classification ¶
func (e *Neo4jError) Classification() string
TODO 6.0: remove in favour of GqlClassification
func (*Neo4jError) Error ¶
func (e *Neo4jError) Error() string
func (*Neo4jError) HasSecurityCode ¶
func (e *Neo4jError) HasSecurityCode() bool
func (*Neo4jError) IsAuthenticationFailed ¶
func (e *Neo4jError) IsAuthenticationFailed() bool
func (*Neo4jError) IsRetriable ¶
func (e *Neo4jError) IsRetriable() bool
func (*Neo4jError) IsRetriableCluster ¶
func (e *Neo4jError) IsRetriableCluster() bool
func (*Neo4jError) IsRetriableTransient ¶
func (e *Neo4jError) IsRetriableTransient() bool
func (*Neo4jError) MarkRetriable ¶
func (e *Neo4jError) MarkRetriable()
func (*Neo4jError) Title ¶
func (e *Neo4jError) Title() string
type Notification ¶
type Plan ¶
type Plan struct { // Operator is the operation this plan is performing. Operator string // Arguments for the operator. // Many operators have arguments defining their specific behavior. This map contains those arguments. Arguments map[string]any // List of identifiers used by this plan. Identifiers used by this part of the plan. // These can be both identifiers introduced by you, or automatically generated. Identifiers []string // Zero or more child plans. A plan is a tree, where each child is another plan. // The children are where this part of the plan gets its input records - unless this is an operator that // introduces new records on its own. Children []Plan }
Plan describes the actual plan that the database planner produced and used (or will use) to execute your statement. This can be extremely helpful in understanding what a statement is doing, and how to optimize it. For more details, see the Neo4j Manual. The plan for the statement is a tree of plans - each sub-tree containing zero or more child plans. The statement starts with the root plan. Each sub-plan is of a specific operator, which describes what that part of the plan does - for instance, perform an index lookup or filter results. The Neo4j Manual contains a reference of the available operator types, and these may differ across Neo4j versions.
type ProfiledPlan ¶
type ProfiledPlan struct { // Operator contains the operation this plan is performing. Operator string // Arguments contains the arguments for the operator used. // Many operators have arguments defining their specific behavior. This map contains those arguments. Arguments map[string]any // Identifiers contains a list of identifiers used by this plan. Identifiers used by this part of the plan. // These can be both identifiers introduced by you, or automatically generated. Identifiers []string // DbHits contains the number of times this part of the plan touched the underlying data stores/ DbHits int64 // Records contains the number of records this part of the plan produced. Records int64 // Children contains zero or more child plans. A plan is a tree, where each child is another plan. // The children are where this part of the plan gets its input records - unless this is an operator that // introduces new records on its own. Children []ProfiledPlan PageCacheMisses int64 PageCacheHits int64 PageCacheHitRatio float64 Time int64 }
ProfiledPlan is the same as a regular Plan - except this plan has been executed, meaning it also contains detailed information about how much work each step of the plan incurred on the database.
type ProtocolError ¶
func (*ProtocolError) Error ¶
func (e *ProtocolError) Error() string
type ProtocolVersion ¶
type Record ¶
type Record struct { // Values contains all the values in the record. Values []any // Keys contains names of the values in the record. // Should not be modified. Same instance is used for all records within the same result. Keys []string }
func (Record) AsMap ¶
AsMap returns a dictionary copy made of the record keys and the corresponding values
Example ¶
record := Record{ Values: []any{true, 42, "yes"}, Keys: []string{"prop1", "prop2", "prop3"}, } dictionary := record.AsMap() output, _ := json.Marshal(dictionary) fmt.Println(string(output))
Output: {"prop1":true,"prop2":42,"prop3":"yes"}
func (Record) Get ¶
Get returns the value corresponding to the given key along with a boolean that is true if a value was found and false if there were no key with the given name.
If there are a lot of keys in combination with a lot of records to iterate, consider to retrieve values from Values slice directly or make a key -> index map before iterating. This implementation does not make or use a key -> index map since the overhead of making the map might not be beneficial for small and few records.
type StatementType ¶
type StatementType int
Definitions of these should correspond to public API
const ( StatementTypeUnknown StatementType = 0 StatementTypeRead StatementType = 1 StatementTypeReadWrite StatementType = 2 StatementTypeWrite StatementType = 3 StatementTypeSchemaWrite StatementType = 4 )
type StreamSummary ¶
StreamSummary is part of the GQL compliant notifications preview feature (see README on what it means in terms of support and compatibility guarantees)
type Summary ¶
type Summary struct { Bookmark string StmntType StatementType ServerName string Agent string Major int Minor int Counters map[string]int TFirst int64 TLast int64 Plan *Plan ProfiledPlan *ProfiledPlan Notifications []Notification GqlStatusObjects []GqlStatusObject Database string ContainsSystemUpdates *bool ContainsUpdates *bool StreamSummary StreamSummary }
type UnsupportedTypeError ¶
func (*UnsupportedTypeError) Error ¶
func (e *UnsupportedTypeError) Error() string