Skip to content

Overview

Querying

This section covers the ways to write and send queries to your SurrealDB database. The main focus is on the SurrealQL query language, which strongly resembles traditional SQL but differs in a number of ways to accommodate patterns such as graph traversal, record links, and other features unique to SurrealDB.

Queries can also be written without using direct SurrealQL through methods such as SDKs in your preferred programming language, GraphQL, or GQL (ISO graph pattern queries on the /gql endpoint). The Postgres wire protocol lets standard Postgres clients (psql, JDBC, etc.) connect and run SurrealQL or GQL with tabular results. Built-in eval::* functions can also run SurrealQL or GQL query strings from inside a transaction when explicitly enabled.

This section also includes tips for writing efficient queries. For more detail, the reference section of the documentation has separate pages for each statement, data type, clause and more for the entire SurrealQL query language.

  • Middleware - run code before and after a custom API handler

Was this page helpful?