Built-in functions
Besides basic JavaScript utilities and classes for SurrealQL types, there are a handful of utilities built into the embedded scripting functions.
| Function | Description |
|---|---|
async fetch(resource, options) | Full fledged fetch implementation closely matching the official specification. |
async query(surql) | Run SurrealQL subqueries from within the embedded scripting functions. |
async value(variable) | Retrieve values for SurrealQL variables from within the embedded scripting functions. |
async fetch(resource, options)
Full fledged fetch implementation closely matching the official specification.
Note
| Arguments | Description |
|---|---|
resource
| Accepts either a url in a string, or a URL or Request object. |
options
| Accepts various options related to the request. Refer to MDN docs for a full reference. |
async query(surql)
Run SurrealQL subqueries from within the embedded scripting functions.
Note
| Arguments | Description |
|---|---|
surql
| Accepts a single SurrealQL query, which is limited to a CRUD operation. |
async value(variable)
Retrieve values for SurrealQL variables from within the embedded scripting functions.
| Arguments | Description |
|---|---|
variable
| Accepts the path to a variable |