# Table

The Table type represents a SurrealDB table name used to scope data operations to an entire 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](https://github.com/surrealdb/surrealdb.go/blob/main/pkg/models/table.go)

---

## Definition

```go
type Table string
```

---

## Methods

### `.String()` {#string}

Returns the table name as a plain string.

```go title="Syntax"
s := table.String()
```

**Returns:** `string`

---

## Usage

```go
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

- [RecordID](/docs/reference/golang/api/values/record-id.md) for targeting specific records
- [Data manipulation](/docs/reference/golang/concepts/data-manipulation.md) for using tables in CRUD operations
