Skip to content

CLI inspect fallback

The CLI and the LSP server share the same tooling semantics. In CLI commands, positions start at 1.

Install the optional CLI in the project that runs these commands:

Terminal window
npm install --save-dev @sqlbraid/cli
Terminal window
sqlbraid inspect query --file src/query.ts --line 8 --column 20 --json
sqlbraid inspect symbol UsersRow --json
sqlbraid inspect diagnostics --file src/query.ts --json

If the discovery of the repository is ambiguous, use --config ./sqlbraid.config.mjs. The JSON output is focused and bounded. Unresolved query evidence has the value resolved: false. This does not claim that the SQL is invalid.

A normal workflow is:

  1. Find the project config and the metadata evidence.
  2. If LSP requests are available, use them first.
  3. If not, use one of the JSON inspection commands above.
  4. If the metadata or the config changes, run sqlbraid codegen. Then run sqlbraid codegen --check.
  5. Treat generated files as derived files. Do not edit them manually.

sqlbraid check can add ordinary TypeScript diagnostics. The inspect operations give only SQLBraid evidence.