neo4j-driver-go-skill

Implements Go applications connecting to Neo4j using the Go Driver v6 API.

Updated Aug 25, 2026
One-click install
npx skills add https://github.com/cardox6/steuer-graph --skill neo4j-driver-go-skill-cardox6
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: neo4j-driver-go-skill
Source: https://github.com/cardox6/steuer-graph/tree/main/.agents/skills/neo4j-driver-go-skill
Command: npx skills add https://github.com/cardox6/steuer-graph --skill neo4j-driver-go-skill-cardox6

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires github.com/neo4j/neo4j-go-driver/v6, and includes references (resource) components.

What problem does it solve? Writing correct Go code against the Neo4j Go Driver v6 requires knowing which API to use (ExecuteQuery vs managed vs explicit transactions), how to handle errors and retries, and how to map Cypher types to Go types. This Skill provides vetted patterns and checklists so you avoid common pitfalls like per-request driver creation, missing database names, and unsafe type assertions. ## Core Features & Use Cases - Driver Lifecycle & Setup: Create one shared driver at startup with VerifyConnectivity, correct URI schemes (neo4j+s:// for Aura), and environment-based credentials. - Query API Selection: Guidance on ExecuteQuery (default), session.ExecuteRead/Write for lazy streaming, BeginTransaction for multi-function coordination, and session.Run for CALL IN TRANSACTIONS. - Error Handling & Type Safety: Patterns for Neo4jError/ConnectivityError inspection, generic helpers like GetRecordValue[T] and CollectTWithContext, and safe record extraction. - Use Case: You are building a Go microservice that reads and writes a Neo4j Aura database. Use this Skill to set up the driver once, run parameterized queries with ExecuteQuery, batch writes with UNWIND, and handle transient errors with managed transaction retries. ## Quick Start Ask the assistant to write a Go function that connects to Neo4j Aura with the v6 driver and runs a parameterized read query using ExecuteQuery.

Frequently Asked Questions about neo4j-driver-go-skill

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect to Neo4j from Go with the v6 driver?▼

Install github.com/neo4j/neo4j-go-driver/v6, then call neo4j.NewDriver with your URI and neo4j.BasicAuth. Verify connectivity at startup with driver.VerifyConnectivity(ctx), create one driver per application, and share it across goroutines.

When should I use ExecuteQuery vs managed transactions in the Neo4j Go driver?▼

Use neo4j.ExecuteQuery as the default for most queries since it handles sessions, retries, and bookmarks automatically. Use session.ExecuteRead/Write when you need lazy streaming of large result sets, and BeginTransaction only when work spans multiple functions.

Does the Neo4j Go driver v6 support struct parameters in queries?▼

Yes, since v6.2.0 a struct or pointer passed in the params map is sent as a Cypher map using neo4j struct tags. Fields tagged with omitempty drop zero values, and neo4j:"-" excludes a field entirely.

Why does my Go Neo4j query return zero results even though the query looks correct?▼

The most common cause is a missing DatabaseName in SessionConfig or ExecuteQueryWithDatabase. Always specify the database explicitly; omitting it also costs an extra network round-trip per call to resolve the home database.

How do I handle Neo4j errors and retries in Go?▼

Use errors.As to distinguish *neo4j.Neo4jError (server-side Cypher errors) from *neo4j.ConnectivityError (network issues). Managed transactions retry transient failures automatically, so callbacks must be free of side effects; explicit transactions require caller-managed retries.

What Go types do Neo4j Cypher values map to?▼

Integers map to int64, floats to float64, lists to []any, maps to map[string]any, and nodes to neo4j.Node. Prefer the generic helper neo4j.GetRecordValue[T](record, key) over manual type assertions to avoid panics on missing keys.