Skip to content

About

Rainbow SQL is a Visual Studio Code extension that brings the readability of rainbow column colorization to SQL `INSERT` statements by coloring column names and their corresponding values with matching rainbow colors

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

Rainbow SQL

Rainbow SQL logo

Rainbow SQL makes SQL INSERT statements easier to read by coloring each column and its corresponding values consistently. It also helps you inspect columns and spot rows with a mismatched number of values.

Tests (main) License

Screenshots

Rainbow SQL highlighting an INSERT statement in Visual Studio Code

Hover details

Hover over a value to see its column number, name, table, and row position.

Hover popup showing column details

Mismatched column / value count detection

Rows whose value count differs from the declared columns are highlighted.

Mismatched column and value count detection

Features

  • Matching column and value colors: follow each declared column through one or more VALUES rows.
  • Single-row and multi-row statements: supports statements laid out on one line or across multiple lines.
  • Column details on hover: inspect the column number, name, table, and row position.
  • Active column in the status bar: see the current column while moving through a statement.
  • Mismatch detection: identify rows whose value count differs from the declared column count.
  • Theme-aware colors: separate palettes for light and dark themes, with customizable colors.
  • SQL-aware parsing: handles quoted values, comments, nested expressions, and common identifier quoting styles.

For example, the values are colored to match their corresponding columns:

INSERT INTO items (id, code, price)
VALUES
  (101, 'ITEM_A', 19.99),
  (102, 'ITEM_B', 24.50);

Supported SQL languages

The extension activates for SQL, PostgreSQL, MySQL, PL/SQL, T-SQL, and SQLite language modes.

Extension settings

Setting Type Default Description
rainbowSql.enabled boolean true Enable or disable column highlighting.
rainbowSql.enableHover boolean true Show column details when hovering over values.
rainbowSql.enableStatusBar boolean true Show the active column in the status bar.
rainbowSql.highlightMismatches boolean true Highlight rows with a different number of values than declared columns.
rainbowSql.darkColors string[] 10 colors Color palette used with dark themes.
rainbowSql.lightColors string[] 10 colors Color palette used with light themes.

Configure these options in VS Code Settings by searching for Rainbow SQL.

Command

Run Rainbow SQL: Toggle Rainbow SQL Highlighting from the Command Palette to turn highlighting on or off.

Questions and issues

If you have a question, find a problem, or would like to suggest an improvement, open an issue on GitHub. For bug reports, include your VS Code version and a small SQL example that demonstrates the issue.

Development

To run the extension from this repository:

  1. Open the repository in VS Code.
  2. Press F5 to launch the Extension Development Host.
  3. Open sample.sql in the new window.

Run the automated tests with:

npm test

CI and releases

GitHub Actions runs the tests and build on pull requests targeting main or v-next, and when changes are pushed to either branch. To publish a release, add a repository Actions secret named VSCE_PAT, then create and publish a GitHub Release with a tag matching the version in package.json (for example, v0.9.0). The release workflow publishes the extension to the Visual Studio Marketplace and attaches the .vsix package to the GitHub Release.

About

Rainbow SQL is a Visual Studio Code extension that brings the readability of rainbow column colorization to SQL `INSERT` statements by coloring column names and their corresponding values with matching rainbow colors

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages