• Start

SurrealQL

Writing SurrealQL

Ways of executing SurrealQL queries such as Surrealist, CLI, HTTP, SDKs, and GraphQL.

SurrealQL is the query language for SurrealDB. How they reach the database depends on your tool or integration. The sections below describe each path in more detail.

The following four approaches are the most commonly used ways to execute SurrealQL queries directly or indirectly via SDKs in one of many programming languages.

ApproachTypical use
SurrealistInteractive editing, Sandbox, and visual results in the browser.
CLILocal development, scripts, and surreal sql against a running server.
HTTPServices and integrations that call the /sql endpoint.
SDKsApplication code using the official clients (WebSocket or HTTP under the hood, depending on SDK and configuration).

For a single entry point into these guides, see Executing queries.

Interactive clients (including the SDKs) usually speak to the database over WebSocket or HTTP. The RPC protocol describes how queries and responses are framed on the wire.

Language syntax, statements, and functions are documented in the SurrealQL reference.

GraphQL is a separate query interface on top of SurrealDB: you describe fields and shapes in GraphQL, not in SurrealQL. You can use it from Surrealist, over HTTP, or from tools such as Postman or Bruno.

Was this page helpful?