Inline SQL Toolkit — Safe Formatting Pipeline

Inline SQL Toolkit — Safe Formatting Pipeline An architecture diagram generated by Archify. Developer · Architecture component Developer Python source · Notebooks · Architecture component Python source Notebooks Command surface · Cursor • selection • all · VS Code extension host • offline Command surface Cursor • selection • all Format controller · Target, trust, cancellation · VS Code extension host • offline · orchestrates Format controller Target, trust, cancellation orchestrates Python analysis engine · Literal scan · VS Code extension host • offline Python analysis engine Literal scan Protected SQL formatter · Bundled sql-formatter · VS Code extension host • offline Protected SQL formatter Bundled sql-formatter WorkspaceEdit applicator · Version + text checks · VS Code extension host • offline WorkspaceEdit applicator Version + text checks Workspace trust gate · Trusted workspace required · Architecture component · fail closed Workspace trust gate Trusted workspace required fail closed Injected SQL grammar · TextMate highlighting · Architecture component Injected SQL grammar TextMate highlighting edit / open invoke format command cursor / selection / all trusted workspace only resolve target + settings protected SQL candidate guarded replacement SQL highlighting VS Code extension host • offline

Detection

  • • Source-level Python literal analysis finds marker or leading-keyword candidates
  • • Jupyter and marimo Python cells use the same document-target resolution

Safety

  • • Untrusted workspaces receive highlighting only; formatting stops before analysis
  • • F-string fields and escapes stay protected while SQL layout changes

Offline edits

  • • Bundled sql-formatter performs layout only; SQL is never executed or validated
  • • Document version and expected text checks guard the final one-step edit