English | 简体中文
Introduction
Compress multi-line SQL into a single-line string, ready to paste into an HTTP request body, a JSON field, a YAML config, or anywhere a newline would break things.
The compressed result is copied to your clipboard — the SQL in your editor is left untouched.
Usage
- Select the SQL text you want to compress.
- Trigger the command in either way:
- Command Palette →
SQLine: Compress SQL to One Line - Right-click the selection →
SQLine: Compress SQL to One Line - Shortcut →
Ctrl + Shift + L
- Command Palette →
- A notification shows the character count before and after, plus a preview. Paste anywhere with
Ctrl + V.
Note on the shortcut:
Ctrl + Shift + Lis bound to Select All Occurrences in the default VS Code keymap. If you rely on that, rebind SQLine viaPreferences: Open Keyboard Shortcutsand search forsqline.compressSql.
What gets compressed
| Rule | Before | After |
|---|---|---|
| CRLF normalized to LF | SELECT 1\r\n |
SELECT 1 |
| Newlines and tabs become spaces | SELECT *\n\tFROM t |
SELECT * FROM t |
| Consecutive spaces collapse into one | SELECT * |
SELECT * |
| Leading and trailing whitespace trimmed | SELECT 1 |
SELECT 1 |
Example:
SELECT
user_id,
COUNT(*) AS cnt
FROM
events
WHERE
dt = '2026-07-30'
GROUP BY
user_id
becomes:
SELECT user_id, COUNT(*) AS cnt FROM events WHERE dt = '2026-07-30' GROUP BY user_id
Feature
- Compresses any selection — no SQL parsing, so dialect never matters
- Result goes to the clipboard, the original SQL stays formatted
- Works from the Command Palette, the context menu, or a keyboard shortcut
Release Note
[0.0.1] - 2026-07-30
Initial release.
Licence
This project is licensed under the MIT License.