For the complete documentation index optimized for AI agents, see llms.txt.Queries for HelixDB can be authored directly in Go with the
github.com/helixdb/helix-db/sdks/go module. The Go SDK is dynamic-first: write
ordinary Go functions that return helix.Request, declare parameters inline, and
execute with client.Exec(ctx, request, &out). There is no bundle-generation step
in the primary Go workflow.
For the traversal model and query patterns themselves, see
Querying and the Querying Guide.
Prerequisites
- Go 1.22 or later.
- Optional: the Helix CLI for local development and ad-hoc query testing.
Create a project
Add the dependency
helix:
Write query functions
Go queries are normal functions. Usehelix.ReadQuery("name") or
helix.WriteQuery("name") to set the dynamic request’s query_name, then declare
runtime parameters inline with methods such as q.ParamString, q.ParamI64, and
q.ParamDateTime.
parameters and parameter_types into the
dynamic envelope.
Parameterize request-specific values
Direct Go values are serialized as literals in the query AST. This is useful for true constants, but it is not a runtime parameter:q.Param* value and pass the returned
ParamRef. That keeps the query shape stable and lets the server reuse cached work
across requests:
helix.PredEq, bounds such
as Limit, mutation properties, and search inputs: pass a ParamRef for
request-specific values, not a direct literal.
Return explicit variables
The names passed toReturning(...) define the top-level response object keys and
should match your response struct tags:
Returning() only when the response is intentionally empty, such
as an idempotent index-creation request. The SDK serializes it as "returns":[].
Execute queries
"" or "http://localhost:6969" to NewClient.
Write queries
Handle conflicts in application code
Client.Exec does not retry HTTP 409 Conflict responses automatically. Retry only
when your operation is safe to replay. Remote errors are returned as
*helix.HelixError with StatusCode set, and conflicts wrap helix.ErrConflict.
Use helix.IsConflict(err) or errors.Is(err, helix.ErrConflict) instead of
parsing the error text.
Next Steps
Querying
Dynamic query envelopes, client execution, and transactions.
Parameters & bundles
Parameter serialization across TypeScript, Rust, Go, and Python.
Local Development
Run HelixDB locally while developing queries.
Go SDK source
Go module source and README.