Installation

Install the SDK from pkg.go.dev using go get:

go get github.com/surrealdb/surrealdb.go

Then import the SDK and its models package in your Go files:

import (
surrealdb "github.com/surrealdb/surrealdb.go"
"github.com/surrealdb/surrealdb.go/pkg/models"
)

The surrealdb package contains the client, query functions, and authentication methods. The models package contains value types such as RecordID, Table, and UUID.

Requirements

  • Go 1.23 or later

  • SurrealDB v2.x or v3.x

Next steps