Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>PHP Inline SQL FormatterNew to Visual Studio Code? Get it now.
PHP Inline SQL Formatter

PHP Inline SQL Formatter

Vivek Makwana

|
22 installs
| (0) | Free
Format inline SQL queries in PHP files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

PHP Inline SQL Formatter

A simple VSCode extension to format inline SQL queries written as strings in PHP files.

Features

  • Detects SQL queries in PHP string assignments
  • Uses sql-formatter to format SQL
  • Works on selected line via command palette

Usage

  1. Open a PHP file with inline SQL.
  2. Place the cursor on the line with the SQL string.
  3. Open Command Palette (Ctrl+Shift+P), run Format SQL in PHP Line.

Example

Before

$select = "SELECT id, name FROM users WHERE active = 1 ORDER BY id DESC";

Commands to build

npm run compile
vsce package
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft