SDK methods
The Golang SDK for SurrealDB has a single SurrealDB class that provides methods for querying a remote SurrealDB database.
The class is designed to be simple to use and easy to understand for developers who are new to Golang or SurrealDB.
This page lists out the methods that are available in the SurrealDB class.
Initialization methods
Query methods
Mutation methods
| Method | Description |
|---|
db.Create[T](table, data) | Creates a record in the database |
db.Insert[T](table, data) | Inserts one or multiple records in the database |
db.InsertRelation[T](table, data) | Inserts one or multiple records in the database |
db.Update[T](table, data) | Updates all records in a table, or a specific record |
db.Upsert[T](table, data) | Creates or updates a specific record |
db.Merge[T](what, data) | Modifies all records in a table, or a specific record |
db.Patch[T](table, data) | Applies JSON Patch changes to all records in a table, or a specific record |
db.Delete(data) | Deletes all records, or a specific record |
Authentication methods