The validate command validates one or many SurrealQL (.surql) language files.
BEFORE YOU STARTMake sure you’ve installed SurrealDB — it should only take a second!
| Arguments | Description | |
|---|---|---|
| [PATTERNS] | Glob pattern for the files to validate [default: ”**/*.surql”] | |
To perform validation on a SurrealQL local file, in a terminal run the surreal validate command with the required argument.
Using the command on its own will validate all the .surql files in the current directory.
You can perform validation on a single file, regardless of extension.
surreal validate user.surql surreal validate user.txt
You can also perform validation on multiple files using a single glob pattern:
# equivalent to "surreal validate" surreal validate **/*.surql
Finally, you can also perform validation on multiple files using multiple paths/patterns:
surreal validate index.surql schemas/*.surql queries/*.surql surreal validate *.(txt|surql)
If any files are invalid, the command will abort at this point and return an error.
To see the help information and usage instructions, in a terminal run the surreal validate --help command without any further arguments. This command gives general information on the arguments, inputs, and additional options for the validate command.
surreal validate --help
The output of the above command: