# taozhi8833998/node-sql-parser

Parse simple SQL statements into an abstract syntax tree (AST) with the visited tableList and convert it back to SQL

Repository: https://github.com/taozhi8833998/node-sql-parser
Canonical: https://ross.abutalabs.com/products/node-sql-parser
Homepage: https://taozhi8833998.github.io/node-sql-parser/
Language: PEG.js
License: Apache-2.0
License Family: permissive
Last push: 2026-07-19T01:42:17+00:00

## Health v2 (maintenance only)
Score: 80/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 53, longevity 100
- inputs: {"age_days": 2815, "days_push": 46, "days_rel": 233, "gap_med": 38, "n_releases_24m": 12}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1038, forks 242 (observed 2026-08-28T04:03:19.773195+00:00)

## What it is
A Node.js and browser library that parses SQL statements into an abstract syntax tree (AST) and converts ASTs back to SQL. It supports multiple database dialects (MySQL, PostgreSQL, TransactSQL, BigQuery, Hive, and more) and reports visited table and column lists with corresponding authorities.

## Use cases
- parse sql queries into an ast in nodejs
- convert an sql ast back into a sql string
- extract tables and columns referenced by a sql query
- validate or lint sql statements for multiple database dialects
- analyze sql permissions by checking visited tables and columns
- parse sql in the browser with a lightweight umd bundle

## When to choose
- you need to parse or generate SQL for multiple database engines in JavaScript
- you want to inspect which tables and columns a query touches, e.g. for access control
- you need a parser that runs in both Node.js and the browser

## When to avoid
- you need a full-fidelity parser for complex or vendor-specific SQL beyond simple statements
- you are not working in the JavaScript ecosystem
- you need query execution rather than parsing and analysis

## Facets
- artifact type: library
- maturity: active
- function: parser, developer-tools
- domain: databases, parsers, developer-tools
- platform: browser
- tags: sql-parser, ast, sql-generation, pegjs, multiple-dialects, nodejs, javascript

## Member repositories
- taozhi8833998/node-sql-parser (main) score 80

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:19.773195+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:04:19.182612+00:00, confidence not recorded.
  - readme: https://github.com/taozhi8833998/node-sql-parser (fetched 2026-08-28T04:03:19.773195+00:00, sha f4fa02ef7c0c)
  - homepage: https://taozhi8833998.github.io/node-sql-parser/ (fetched 2026-08-29T13:05:00.704078+00:00, sha 35ba1b60863a)
- Data as of 2026-08-30T08:39:29.467469+00:00.
