Table
The Table type is a named string type representing a SurrealDB table name. It is used with data manipulation functions like Select, Create, Insert, and Delete to target all records in a table.
Package: github.com/surrealdb/surrealdb.go/pkg/models
Source: pkg/models/table.go
Definition
type Table string
Methods
.String()
Returns the table name as a plain string.
Syntax
s := table.String()
Returns: string
Usage
import "github.com/surrealdb/surrealdb.go/pkg/models"
persons, err := surrealdb.Select[[]Person](ctx, db, models.Table("persons"))
_, err = surrealdb.Insert[Person](ctx, db, models.Table("persons"), data)
Table is encoded as CBOR tag 7 when sent over the wire.
See Also