The Table type is a named string type that holds the name of a SurrealDB table. Pass a Table to Select, Update or Delete to work on every record in the table, or to Create and Insert to add records to it.
Package: github.com/surrealdb/surrealdb.go/v2/pkg/models
Source: pkg/models/table.go
Definition
type Table stringMethods
.String()
Returns the table name as a plain string.
Syntax
s := table.String()Returns: string
Usage
import "github.com/surrealdb/surrealdb.go/v2/pkg/models"
persons, err := surrealdb.Select[[]Person](ctx, db, models.Table("persons"))
_, err = surrealdb.Insert[Person](ctx, db, models.Table("persons"), data)The SDK sends a Table as CBOR tag 7.
See also
RecordID for targeting specific records
Data manipulation for using tables in CRUD operations