Skip to main content
Version: 1.x

Statements

SurrealDB has a variety of statements that let you configure and query a database: CREATE, INSERT, UPDATE, and so on.

Statement parameters

A number of parameters prefixed with $ are automatically available within a statement that provide access to relevant context inside the statement. These are known as reserved variable names. For example:

  • $before and $after can be accessed in statements that mutate values to see the values before and after an update,
  • $session provides context on the current session,
  • $parent provides access to the value in a primary query while inside a subquery.

For a full list of these automatically generated parameters, see the parameters page.