neo4j-driver-go-skill

Configure the neo4j-go-driver v6 and execute parameterized Cypher queries in Go.

101|35|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/neo4j-contrib/neo4j-skills --skill neo4j-driver-go-skill
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: neo4j-driver-go-skill
Source: https://github.com/neo4j-contrib/neo4j-skills/tree/main/neo4j-driver-go-skill
Command: npx skills add https://github.com/neo4j-contrib/neo4j-skills --skill neo4j-driver-go-skill

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Neo4j Go developers struggle to correctly initialize the Neo4j Go Driver, choose the right query execution API, and handle sessions, transactions, errors, and result type mapping without fragile boilerplate or subtle production bugs.

Core Features & Use Cases

  • Driver lifecycle and connectivity verification: Create one goroutine-safe driver per application and verify connectivity at startup.
  • Correct query execution patterns: Use neo4j.ExecuteQuery as the recommended default, and pick managed vs explicit transactions based on streaming and coordination needs.
  • Robust data handling and error checking: Map Go/Cypher types safely (including nulls), extract record values without unsafe assertions, and handle Neo4jError vs ConnectivityError.
  • Production operational guardrails: Propagate context with timeouts, specify the database explicitly, and apply batching writes using UNWIND.

Quick Start

Install and write Go code using the Neo4j Go Driver v6 to connect to your database with neo4j.NewDriver, call driver.VerifyConnectivity, and run queries via neo4j.ExecuteQuery with database routing and parameterized inputs.

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 execute queries with the Neo4j Go driver safely?

To execute queries safely with the Neo4j Go driver, use `neo4j.ExecuteQuery` as the recommended default API with parameterized Cypher inputs. This approach handles managed transaction streaming for large results and ensures safe Go↔Cypher data type mapping without fragile boilerplate.

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

Use `neo4j.ExecuteQuery` for standard query execution, but switch to explicit transactions via `BeginTransaction` when you need multi-step coordination. Managed transactions (`ExecuteRead`/`ExecuteWrite`) are preferred for handling large result streaming in the Neo4j Go driver.

How do I handle errors and type mapping in the Neo4j Go driver?

Handle Neo4j Go driver errors by distinguishing `Neo4jError` from `ConnectivityError`. Ensure safe Go↔Cypher type mapping by extracting record values without unsafe assertions, properly managing null values to prevent subtle production bugs.

What is the correct way to initialize the Neo4j Go driver for production?

Initialize the Neo4j Go driver for production by creating one goroutine-safe driver instance per application using `neo4j.NewDriver`. Call `driver.VerifyConnectivity` at service startup, specify the database explicitly, and propagate `context` with timeouts.

How do I manage causal consistency and bookmarks with the Neo4j Go driver?

Manage causal consistency in the Neo4j Go driver by maintaining bookmark awareness across transactions. This ensures read-after-write consistency by routing subsequent read queries to the correct cluster member using session bookmarks.

How do I perform batch writes using the Neo4j Go driver?

Perform batch writes in the Neo4j Go driver by using parameterized Cypher queries with `UNWIND`. This allows efficient bulk data ingestion by passing large parameter arrays to `neo4j.ExecuteQuery`, ensuring safe type mapping and robust error handling.