Click here to sign up to SurrealDB Cloud

Back to top
Documentation SurrealQL Statements DEFINE statement PARAM

DEFINE PARAM statement

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


Statement syntax

DEFINE PARAM $@name VALUE @value;

Example usage

Below shows how you can define a global parameter using the DEFINE PARAM statement.

DEFINE PARAM $endpointBase VALUE "";

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

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