> ## Documentation Index
> Fetch the complete documentation index at: https://ngquct-feat-ai-sql-walkthroughs.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

# SurrealDB Connections

TablePro connects to SurrealDB 2.x and 3.x over the HTTP RPC protocol. Browse namespaces and databases in the sidebar, run SurrealQL in the editor, and edit records inline in the data grid.

The driver talks CBOR, so record links, datetimes, durations, decimals, and UUIDs keep their types instead of arriving as plain strings.

## Quick Setup

Click **New Connection**, select **SurrealDB**, enter the host and port (default `8000`), pick an auth level, and connect. The plugin installs on first use, or install it from **Settings** > **Plugins** > **Browse** > **SurrealDB Driver**.

TablePro registers the `surrealdb://` URL scheme, so `surrealdb://user:pass@host:8000` links pre-fill the connection form (see [Connection URL Reference](/databases/connection-urls)). For a remote server, connect through an [SSH tunnel](/databases/ssh-tunneling).

## Namespaces and databases

SurrealDB nests tables under a namespace and a database. TablePro maps that straight onto the sidebar: namespaces sit at the top level, databases sit inside them, and tables sit inside a database. Switch either level without reconnecting.

Set the namespace in the **Namespace** field when you create the connection. Leave **Database** empty to pick one from the sidebar after connecting.

## Authentication

SurrealDB cannot infer which level your credentials belong to, so pick the one that matches the user you are signing in as.

| 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 can list every namespace. With namespace or database credentials, TablePro browses the scope your user is limited to.

## Connection Settings

### Required Fields

| Field          | Description                                        |
| -------------- | -------------------------------------------------- |
| **Host**       | Server host, e.g. `localhost`                      |
| **Port**       | HTTP port, default `8000`                          |
| **Auth Level** | Root, Namespace, Database, Record Access, or Token |

### Optional Fields

| Field                     | Description                                                                                        |
| ------------------------- | -------------------------------------------------------------------------------------------------- |
| **Namespace**             | The namespace to open. Required for every level except Root and Token                              |
| **Database**              | The database to open. Required for Database and Record Access; otherwise pick one from the sidebar |
| **SSL**                   | Enable to connect over HTTPS                                                                       |
| **Skip TLS Verification** | Trust a self-signed certificate (Advanced section)                                                 |
| **Token**                 | A JWT, shown when Auth Level is Token                                                              |
| **Access Method**         | The name from `DEFINE ACCESS`, shown when Auth Level is Record Access                              |

## Editing records

<Frame caption="SurrealDB records in the data grid">
  <img className="block dark:hidden" src="https://mintcdn.com/ngquct-feat-ai-sql-walkthroughs/Bj1EoTflf_jG6N_3/images/surrealdb-record-grid.png?fit=max&auto=format&n=Bj1EoTflf_jG6N_3&q=85&s=293c27fa9722b52f1c30460f165e6850" 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-feat-ai-sql-walkthroughs/Bj1EoTflf_jG6N_3/images/surrealdb-record-grid-dark.png?fit=max&auto=format&n=Bj1EoTflf_jG6N_3&q=85&s=e8a81069a5db0d0d44322b0e9744ad86" 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>

The grid writes one field at a time. Changing a cell runs an `UPDATE` that sets only the fields you touched, so computed `FUTURE` fields and fields another writer changed are left alone.

* `id` is the primary key and is read-only. Clear it on a new row to let SurrealDB generate one.
* 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`.

Values are sent as typed parameters, so an `int` column stays an `int` and a filter value is never treated as SurrealQL.

## Schemaless tables

A `SCHEMALESS` table has no declared fields. TablePro reads the columns from the rows it fetched, so a field only some records carry still gets a column, and records missing it show an empty cell.

## Query plans

The Explain button in the editor offers **Explain** and **Explain Full**, which run the current query with SurrealDB's `EXPLAIN` and `EXPLAIN FULL` to show how it resolves, for example whether an index is used.

## Limitations

* Transactions are not available. Each request is independent over HTTP, so `BEGIN` in one request cannot affect another. Run `BEGIN TRANSACTION; ... COMMIT TRANSACTION;` as a single query in the editor instead.
* The structure editor is read-only. Create and change fields and indexes with `DEFINE FIELD` and `DEFINE INDEX` in the editor.
* Live queries (`LIVE SELECT`) are not supported.
* Range values display but cannot be edited.
* The editor treats SurrealQL as plain text, without syntax coloring.
* SurrealDB 1.x is not supported.
