> ## Documentation Index
> Fetch the complete documentation index at: https://docs.helix-db.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Go SDK

> Build and execute HelixDB requests with ordinary Go functions

<div className="flex flex-wrap gap-2"><Badge color="blue" size="sm">Guide</Badge></div>

The Go SDK builds the shared operation-tree AST and executes requests through a
typed HTTP client.

<Note>
  Version `v0.3.1` ships the server query builder and HTTP client. It does not
  distribute the native bindings required by embedded execution or native graph
  algorithms.

  The module path remains `github.com/helixdb/helix-db/sdks/go`; it does not add a
  `/v3` suffix because the module itself has not reached major version 2.
</Note>

## Install

```bash theme={"languages":{"custom":["languages/helixql.json"]}}
go get github.com/helixdb/helix-db/sdks/go@v0.3.1
```

```go theme={"languages":{"custom":["languages/helixql.json"]}}
import helix "github.com/helixdb/helix-db/sdks/go"
```

## Define a query

```go theme={"languages":{"custom":["languages/helixql.json"]}}
func FindUsers(tenantID string, limit int64) helix.Request {
	q := helix.ReadQuery("find_users")
	tenant := q.ParamString("tenant_id", tenantID)
	maxRows := q.ParamI64("limit", limit)

	return q.
		VarAs(
			"users",
			helix.G().
				NWithLabel("User").
				Where(helix.PredEq("tenantId", tenant)).
				Limit(maxRows).
				ValueMap("$id", "name", "tenantId"),
		).
		Returning("users")
}
```

## Execute

```go theme={"languages":{"custom":["languages/helixql.json"]}}
client, err := helix.NewClient("http://localhost:6969")
if err != nil {
	return err
}

var response struct {
	Users []map[string]any `json:"users"`
}
if err := client.Exec(ctx, FindUsers("acme", 25), &response); err != nil {
	return err
}
```

Write requests can pass `helix.WriterOnly()` and `helix.AwaitDurability(true)` execution
options. The client does not retry conflicts automatically.

## Release scope

Use `v0.3.1` with a local or remote Helix server through `/v2/query`. Embedded
constructors and `Client.Graph` return native-binding-unavailable errors in a
standard module installation.

## Verify

```bash theme={"languages":{"custom":["languages/helixql.json"]}}
cd sdks/go
go test ./...
```

## Next steps

<CardGroup cols={2}>
  <Card title="Parameters" icon="sliders" href="/database/helix-db/query-guides/parameters">
    Bind typed values and bounds.
  </Card>

  <Card title="Error handling" icon="triangle-exclamation" href="/database/helix-cloud/operate/troubleshooting">
    Diagnose validation, conflict, and runtime failures.
  </Card>
</CardGroup>
