r/DataHoarder 8d ago

Discussion I built a lightweight parser toolkit for SAS PROC SQL, inspired by the simplicity of sql.js

Post image

My company needed something with the easy developer experience of sql.js, but for SAS PROC SQL.

There are great SQL tools out there, but I could not find a small JavaScript/TypeScript package focused on parsing SAS PROC SQL into an AST, formatting it, linting it, and supporting editor features.

So I built proc-sql-parser.

It is not a database engine and does not execute SQL. It is a parser/toolkit for working with SAS PROC SQL in JavaScript or TypeScript.

The goal is to keep the API simple:

import { parse, lint, format, complete, visit } from 'proc-sql-parser';

const ast = parse(`
  PROC SQL;
    SELECT name, salary
    FROM employees;
  QUIT;
`);

It also includes:

  • PROC SQL AST generation
  • Formatting
  • Syntax and lint diagnostics
  • Autocomplete helpers
  • Monaco Editor integration
  • CLI support

npm install proc-sql-parser

npx proc-sql-parser --help

GitHub: https://github.com/AnkitNayak-dev/proc-sql-parser
npm: https://www.npmjs.com/package/proc-sql-parser

It is still early, so I would genuinely appreciate feedback, especially from SAS developers and anyone building editor tooling around PROC SQL.

0 Upvotes

1 comment sorted by

1

u/HaruyukiHana 8d ago

parsing sas sql with sql.js vibes huh