Skip to content

API Reference

/

Values

Table

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

type Table string

Returns the table name as a plain string.

Syntax
s := table.String()

Returns: string

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.

Was this page helpful?

Last updated