doc/DEBUGGING.md
To use the VSCode debugger with SurrealDB there are a few steps to get setup. This guide walks you through setup and configuration.
Install CodeLLDB 1.11.5 or greater.
Settings:
Set LLDB → Launch: Breakpoint Mode to path.
Set LLDB → Launch: Terminal to integrated.
Set LLDB → Launch: Init Commands to:
"lldb.launch.initCommands": [
"command script import ${userHome}/.rustup/toolchains/1.86-aarch64-apple-darwin/lib/rustlib/etc/lldb_lookup.py",
"command source ${userHome}/.rustup/toolchains/1.86-aarch64-apple-darwin/lib/rustlib/etc/lldb_commands"
]
The launch.json is used to specify debugger configuration. The following configuration will setup
the interactive sql shell to run in the debugger so you can run adhoc commands and inspect the
state of the program.
{
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug surrealdb",
"cargo": {
"args": [
"build",
"--no-default-features",
"--features",
"storage-mem,http,scripting"
],
},
"args": [
"sql",
"--ns", "ns",
"--db", "db",
"--endpoint", "memory"
],
"cwd": "${workspaceFolder}",
"sourceLanguages": ["rust"]
}
]
}
Debug view in VSCode. (Ctrl+Shift+D or Cmd+Shift+D on macOS).Debug surrealdb configuration. (F5)sql shell will be launched.Debug Console to run commands and inspect the state of the program.Stop button in the
Debug view or by pressing Shift+F5.