Back to Explore

scriptcoded/sql-highlight

GitHub
1 watchersOpen source

Last release:

sql-highlight is a lightweight SQL syntax highlighting library written in pure JavaScript. It highlights SQL queries for terminal output using Unicode escape sequences, or renders highlighted HTML spans (optionally escaping HTML entities). It also exposes getSegments so you can parse SQL into labeled segments for custom highlighting.

Project status

  • Maintenance status: GitHub shows a very recent upstream push on 2026-08-10, which suggests the project is still actively worked on, though the most recent published updates in the provided changelog stop at v6.1.0 (2025-06-06).
  • Update cadence: Versioned updates appear infrequent (notably, about 11 months between v6.1.0 in 2025 and the next older listed release v6.0.0 in 2024, and no new tagged updates shown since v6.1.0 despite the 2026 push).

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v6.1.0

    v6.1.0 primarily adds the DECLARE keyword for procedural PL/SQL highlighting. The code diff also shows a large reorder/reshape of the internal keyword list used for highlighting, plus several maintainer tooling changes (Biome, semantic-release, lint script naming). No public runtime API changes are evident from the provided diff.

    Features
  • v6.0.0

    v6.0.0 updates sql-highlight’s SQL tokenization and styling. The release notes call out a breaking change where the previous default segment is split into identifier and whitespace segments, plus improvements to number/operator detection.

    BreakingFeatures
  • v5.0.0

    Release v5.0.0 primarily updates supported Node.js versions by adding Node 22 and dropping Node 14. The code diff also shows CI workflow adjustments and a large package-lock.json churn, which strongly suggests dependency updates beyond what the release notes explicitly mention.

    BreakingFeatures
  • v4.4.2

    Version 4.4.2 is a small update that adds support for the SQL COMMIT keyword. The release notes only mention this keyword addition, and the code changes align with that description.

  • v4.4.1

    v4.4.1 primarily adds support for the SQL RETURNING keyword in the syntax highlighter. The release notes only mention this bug fix, but the actual diff also includes substantial CI and release workflow changes, plus Node.js version/test matrix updates and multiple dev dependency bumps.

  • v4.4.0

    v4.4.0 adds support for SQL comments (single-line, MySQL '#', and block comments) and improves overall tokenization performance. The implementation replaces the previous multi-regex token scanning with a single combined tokenizer regex, which can subtly change how segments are produced even for non-comment tokens.

    Features
  • v4.3.3

    v4.3.3 primarily adds support for the SQL ILIKE keyword so it can be highlighted like other recognized keywords. The release notes only mention this bug fix, but the diff also includes repository CI workflow changes, documentation badge updates, and multiple development dependency bumps.

  • v4.3.2

    v4.3.2 ships a fix to the SQL number highlighter. The only runtime code change shown is an update to the numeric regex used to detect number tokens during highlighting.

  • v4.3.1

    Release v4.3.1 contains no documented library/API changes in the release notes, only a generic “release 4.3.1” chore entry. The code diff instead shows automation and repository maintenance updates, plus development dependency version bumps and corresponding lockfile changes.

  • v4.3.0

    v4.3.0 introduces HTML-escaping for content when `highlight(..., { html: true })` is used, preventing raw special characters from being emitted into the HTML output. It adds a new `htmlEscaper` option (defaulting to a built-in escaper) to control how escaping is performed.

    BreakingSecurityFeatures