Skip to main content
Version: 1.0.2

DEFINE PARAM

DEFINE PARAM statement

The DEFINE PARAM statement allows you to define global (database-wide) parameters that are available to every client.

Requirements

Statement syntax

SurrealQL Syntax
DEFINE PARAM $@name VALUE @value;

Example usage

Below shows how you can create a namespace using the DEFINE PARAM statement.

DEFINE PARAM $endpointBase VALUE "https://dummyjson.com";

Then, simply use the global parameter like you would with any variable.

RETURN http::get($endpointBase + "/products");