> ## Documentation Index
> Fetch the complete documentation index at: https://ngquct-docs-fix-500-query-results.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SurrealDB

> Connect to SurrealDB with namespace and database browsing, SurrealQL, and inline record editing

export const name_0 = "SurrealDB"

export const plugin_0 = "SurrealDB Driver"

Whichever level your user was defined at, Root, Namespace, Database, or Record Access, **Auth Level** has to name it. SurrealDB cannot infer it from the credentials, and the rest of the form follows from that one field.

## Quick setup

Click **Create Connection…**, select **SurrealDB**, enter the host and port, pick the auth level that matches your user, and connect. The driver needs SurrealDB 2.0 or later and talks CBOR over the HTTP RPC endpoint, so record links, datetimes, durations, decimals, and UUIDs keep their types.

The {name_0} driver is not in the app. Picking {name_0} in the **Choose a Database** sheet offers the
download before the form opens, and opening a saved {name_0} connection installs it without asking.
**Settings > Plugins > Browse > {plugin_0}** installs it up front. See [Plugins](/features/plugins).

## Connection settings

| Field                   | Description                                                                                           |
| ----------------------- | ----------------------------------------------------------------------------------------------------- |
| **Host**                | Server host, such as `localhost`                                                                      |
| **Port**                | HTTP port, default `8000`                                                                             |
| **Namespace**           | The namespace to open                                                                                 |
| **Auth Level**          | Which level your credentials belong to                                                                |
| **Username / Password** | Every level except Token                                                                              |
| **Database**            | Shown for Database and Record Access. At the other levels, pick one from the sidebar after connecting |
| **Token**               | A JWT, shown for Token                                                                                |
| **Access Method**       | The name from `DEFINE ACCESS`, shown for Record Access                                                |

## Connection URL

```text theme={null}
surrealdb://user:pass@host:8000
```

The scheme is registered with macOS, so a link like that opens the connection form pre-filled. See [Connection URL Reference](/connections/urls). For a remote server, connect through an [SSH tunnel](/connections/ssh-tunneling).

## Authentication

| Auth Level        | Use it for                                                | Needs                                                     |
| ----------------- | --------------------------------------------------------- | --------------------------------------------------------- |
| **Root**          | A root user, defined with `DEFINE USER … ON ROOT`         | Username, password                                        |
| **Namespace**     | A namespace user                                          | Username, password, namespace                             |
| **Database**      | A database user                                           | Username, password, namespace, database                   |
| **Record Access** | A record user, defined with `DEFINE ACCESS … TYPE RECORD` | Namespace, database, access method, and the signin fields |
| **Token**         | A JWT you already hold, including SurrealDB Cloud         | The token                                                 |

Only a root user lists every namespace; other levels browse the scope the user is limited to.

## Namespaces and databases

Namespaces sit at the top of the sidebar, databases inside them, tables inside a database. Neither switch reconnects. The namespace and database ride on each request, and a tab bound to a second database keeps the same connection.

Right-click a namespace for **Drop Namespace…** (`REMOVE NAMESPACE`) or a database for **Drop Database…** (`REMOVE DATABASE`). Select several with Shift-click or Cmd-click and one confirmation covers all of them. See [Work on Several Databases at Once](/features/table-operations#databases-and-schemas).

## Records in the grid

<Frame caption="SurrealDB records in the data grid">
  <img className="block dark:hidden" src="https://mintcdn.com/ngquct-docs-fix-500-query-results/0TDhsORsgVLO0zL5/images/surrealdb-record-grid.png?fit=max&auto=format&n=0TDhsORsgVLO0zL5&q=85&s=2a9e84122a8756498fef9723760224e3" alt="SurrealDB table records with record links and typed values in the data grid" width="1560" height="960" data-path="images/surrealdb-record-grid.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/ngquct-docs-fix-500-query-results/HJY892UtvXUv1PFn/images/surrealdb-record-grid-dark.png?fit=max&auto=format&n=HJY892UtvXUv1PFn&q=85&s=a3b6031c078dcdabe4b9e98f38e940e5" alt="SurrealDB table records with record links and typed values in the data grid" width="1560" height="960" data-path="images/surrealdb-record-grid-dark.png" />
</Frame>

Changing a cell runs an `UPDATE` that sets only the fields you touched, leaving computed `FUTURE` fields and another writer's changes alone. Values go out as typed parameters, so an `int` stays an `int` and a filter value is never parsed as SurrealQL.

* `id` is the primary key and read-only. Leave it empty on a new row for a generated one, or type `table:id` to choose it.
* A record link shows as `table:id`. Objects and arrays show as compact JSON and are edited as JSON.
* On a `RELATION` table, `in` and `out` sit next to `id`.
* A `SCHEMALESS` table has no declared fields, so its columns come from the rows fetched: a field only some records carry still gets a column, and the rest show an empty cell.

## SurrealQL

The editor runs whole SurrealQL scripts, with completions for the common statements:

```sql theme={null}
SELECT * FROM person LIMIT 100;
RELATE person:alice->wrote->article:one SET time = time::now();
```

The Explain button offers **Explain** and **Explain Full**, which rerun the current query with `EXPLAIN` and `EXPLAIN FULL` to show how it resolves, including whether an index is used.

## SSL/TLS

**Disabled** is the default and connects over HTTP; every other mode connects over HTTPS. **Preferred** and **Required (skip verify)** accept any certificate, **Verify CA** and **Verify Identity** check it against the system trust store.

<Warning>
  **Skip TLS Verification**, a toggle in the Advanced pane, trusts any certificate even when the mode is **Verify CA** or **Verify Identity**. Leave it off outside a development server with a self-signed certificate.
</Warning>

## Limitations

* The structure editor is read-only. Create and change fields and indexes with `DEFINE FIELD` and `DEFINE INDEX` in the editor.
* Editing `in` or `out` on a `RELATION` table does nothing: those fields are dropped from the generated `UPDATE`. Rewire a relation with `RELATE` or an explicit `UPDATE`.
* Multi-request transactions are not available over HTTP. Send `BEGIN TRANSACTION; … COMMIT TRANSACTION;` as one editor query instead.
* Live queries (`LIVE SELECT`) are not supported. Rerun the query to see new records.
* A CA certificate file set in the **SSL/TLS** pane is ignored; verification goes through the system trust store, so install a private CA there.
* Import is not available. Export works, see [Import and Export](/features/import-export).
* Range values display but cannot be edited.
* The editor treats SurrealQL as plain text, with no syntax coloring.
* SurrealDB 1.x is not supported.

## Troubleshooting

### … is required for the selected authentication level

The level needs a scope the form has not been given. Namespace, Database, and Record Access all need **Namespace**; the last two also need **Database**; Record Access also needs **Access Method**.

### SurrealDB … is not supported. TablePro requires SurrealDB 2.0 or later.

The version comes from the server's own `/version` reply. Upgrade the server, or point the connection at a 2.x or 3.x instance.

### SurrealDB over HTTP does not support multi-request transactions.

A transaction cannot span requests over HTTP RPC. Put the whole transaction in one editor query.

### The credentials do not match the auth level

A root user signed in at Database level fails, and so does the reverse. Match the level to how the user was defined.
